⬅︎ Back to bool is instance of int in Python
It is indeed kind of warty.Presumably you already knew about this:>>> d = {(3.0 +0j): "something"}>>> d[3]'something'>>> The Boolean behavior is similar, though slightly different. This was not one of Guido's best ideas - *and* it was introduced in a minor release!
Comment
It is indeed kind of warty.
Presumably you already knew about this:
>>> d = {(3.0 +0j): "something"}
>>> d[3]
'something'
>>>
The Boolean behavior is similar, though slightly different. This was not one of Guido's best ideas - *and* it was introduced in a minor release!