One pet peeve I have is that people often write code like this:
def isValid():
myBool = False
if myBool == True: # note this can also be simplified to simply myBool instead of myBool == True, but I'm often not sure what the best way to go about this is since the former tests for false-y values instead of boolean values
return True
else:
return False
When this can be simplified to:
def isValid():
myBool = False
return myBool
One pet peeve I have is that people often write code like this:
When this can be simplified to: