3 ms·
This is outside of the spec... "is" is for testing the exact same reference and it is only coincidence that to speed things up they made smaller integers the sa
by th0ma5 6y ago
This is outside of the spec... "is" is for testing the exact same reference and it is only coincidence that to speed things up they made smaller integers the same objects in memory. See:
>>> a=257
>>> b=a
>>> a is b
True
What you want is double equals.