I'm curious about the behavior of the following code:
0.0 is 0.0 # True
a = 0.0
a is 0.0 # False
It seems to me that a is 0.0
should evaluate to True. In my particular case I need to distinguish when a variable is 0.0 specifically, so a == 0
will not work because it will fail when a
is equal to False. What's the best way to accomplish this?