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

Mark Lawrence breamoreboy at yahoo.co.uk
Thu Apr 26 19:47:02 EDT 2012


On 20/04/2012 20:10, dmitrey wrote:
> 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?

-- 
Cheers.

Mark Lawrence.




More information about the Python-list mailing list