Alan Bawden <a...@csail.mit.edu> wrote: >Chris Angelico <ros...@gmail.com> writes: > ... >> Python 2.7.8 (2.4.0+dfsg-3, Dec 20 2014, 13:30:46) >> [PyPy 2.4.0 with GCC 4.9.2] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >>>>>> tuple([]) is tuple([]) >> False > >I said I wouldn't be suprised if it was always true, but that doesn't >imply that I need to be suprised if it is sometimes false! > >Having said that, I _am_ curious whether that remains False for various >other variant expressions. "tuple([])" is actually a rather perverse >way to obtain an empty tuple. How about plain "() is ()"? ...
Still false in PyPy it seems [PyPy 2.6.1 with GCC 4.9.2] on linux2 >>>> id(()) 139836165383760L >>>> id(()) 139836165383776L (Conversely, I see that unlike CPython, all PyPy's numbers have unchanging ids, even after exiting PyPy and restarting, so it seems that PyPy's numerical ids are "faked".) [PyPy 2.6.1 with GCC 4.9.2] on linux2 >>>> id(1+2j) 679900119843984469027190799480815353863L [PyPy 2.6.1 with GCC 4.9.2] on linux2 >>>> id(1+2j) 679900119843984469027190799480815353863L -- https://mail.python.org/mailman/listinfo/python-list