3 ms·
For more details: http://stackoverflow.com/questions/306313/python-is-operator-behaves-unexpectedly-with-integers http://stackoverflow.com/questions/306313/pyt
by audeyisaacs 13y ago
For more details:
http://stackoverflow.com/questions/306313/python-is-operator-behaves-unexpectedly-with-integers http://stackoverflow.com/questions/306313/python-is-operator...
- nslocum 13y agoAfter a little trial and error, it appears that Python caches the values in range(-5,257). > -6 + 0 is -6 False > -5 + 0 is -5 True > 256 + 0 is 256 True > 257 + 0 is 257 False
- wahnfrieden 13y ago(CPython)