why () is () and [] is [] work in other way?

dmitrey dmitrey15 at gmail.com
Fri Apr 20 15:10:05 EDT 2012


I have spent some time searching for a bug in my code, it was due to
different work of "is" with () and []:
>>> () is ()
True
>>> [] is []
False

(Python 2.7.2+ (default, Oct  4 2011, 20:03:08)
[GCC 4.6.1] )

Is this what it should be or maybe yielding unified result is better?
D.



More information about the Python-list mailing list