I keep getting an error saying 'Unnecessary "else" after "return"'
What is it trying to tell me, and what would be a more elegant way to code this logic?
for selected_node in NODES: if pm.nodeType(selected_node) == 'file': msg = 'correct type of nodes selected' LOGGER_TEXTURE_SWAP.debug(msg) return True else: msg = 'incorrect type of nodes selected' LOGGER_TEXTURE_SWAP.debug(msg) return False
else:? I don't think this is an error, it is redundant as you don't need it. Just remove it and unindent the body. The loop is unnecessary as well.