Never, never, never say
if something == True:
Never. It's crazy, since you're redundantly repeating what is redundantly specified as the redundant condition rule for an if-statement.
Worse, still, never, never, never say
if something == False:
You have not
. Feel free to use it.
Finally, doing a == None
is inefficient. Do a is None
. None
is a special singleton object, there can only be one. Just check to see if you have that object.