Serhiy Storchaka <[email protected]> added the comment:
This is not only with integers.
>>> a = ((1, 2), (1, 2))
>>> a[0] is a[1]
False
>>> a = ('@#$', '@#$')
>>> a[0] is a[1]
False
>>> a = (1.0, 1.0)
>>> a[0] is a[1]
False
The only exception is short ASCII identifier-like strings (as a side effect of
interning them):
>>> a = ('foo', 'foo')
>>> a[0] is a[1]
True
I'm not sure this is a problem which should be resolved.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34100>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com