4 ms·
`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 e
by h8hawk 6y ago
`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.