Open madscatt opened 6 years ago
In Python 2.7 booleans are subclassed from ints. True and False are not constants!
https://blog.rmotr.com/those-tricky-python-booleans-2100d5df92c
Perhaps name all booleans with a suffix _bool e.g.
some_variable_bool
instead of
some_variable
Sometimes a variable is defined as a string but the programmer thinks it is a boolean. If one uses statements like
`my_boolean = "False"'
if my_boolean:
will evaluate as True as the my_boolean string exists. We should consider more robust usage of booleans to avoid these types of mistakes.
Note that
my_boolean = ""
if my_boolean:
will evaluate as False.