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

Prasad, Ramit ramit.prasad at jpmorgan.com
Fri Apr 27 14:22:44 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.
> 
> Congratulations, you've managed to introduce the most useless thread on
> this ng/ml that I've come across in the ten years that I've been using
> (c)Python.
> 
> I've never ever thought about using this weird thing called "id" in my
> code, (which comes later in all the responses) so why do some people
> think it's so important?
>

Somewhere out there (possibly in an alternate universe) Bill Clinton is reading this thread and nodding vigorously about an argument around the [key]word "is".



Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  



More information about the Python-list mailing list