"/a" is not "/a" ?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sat Mar 7 09:50:33 CET 2009


On Fri, 06 Mar 2009 16:26:46 -0800, Paul Rubin wrote:

> Gary Herron <gherron at islandtraining.com> writes:
>>   Experts: Singleton immutable types *may* be compared with "is",
> 
> That is absolutely wrong:
> 
>     >>> a = 2^100
>     >>> b = 2^100
>     >>> a == b
>     True
>     >>> a is b
>     False

What should this example show?  And where's the singleton here?  BTW:

In [367]: a = 2 ^ 100

In [368]: b = 2 ^ 100

In [369]: a == b
Out[369]: True

In [370]: a is b
Out[370]: True

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list