‘is’ operator behaves unexpectedly with floats
This has to do with how is works. It checks for references instead of value. It returns True if either argument is assigned to the same object. In this case, they are different instances; float(0) and float(0) have the same value ==, but are distinct entities as far as Python is concerned. CPython implementation also … Read more