If I were to set a variable as False, it is read as being equal to zero. Is there any way I can carry out a check to see if the variable if actually False or if it\'s the number
You can test if the object is the False
singleton value, by testing for identity:
if Spam is False:
You should really refactor your code to not have to rely on the type here; None
is a better false-y sentinel value to use, yes.
In general, use None
as a sentinel meaning 'no value set', or if you should support None
as well, use a unique object as a sentinel:
_sentinel = object()
# ...
if option is _sentinel:
# no value set