Re:Why does `True == False is False` evaluate to False in Py...
by h8hawk on Saturday May 02, 2020 @09:09AM
(#23051557)
`is` is identity comparison and in python everything is "object". It check if two variable refer to same object (location in memory) or not. So you should not expect that `a is b` for `a=1.2 , b=1.2` be true. In this case actually first expression returned True is weird. because 0-256 objects are cached and every instance of them refer to same object.
[ Parent
| on HN ]
There are no comments on this comment yet.