is and ==

Oleg Broytmann phd at phd.pp.ru
Mon Feb 26 11:56:45 EST 2001


On Mon, 26 Feb 2001, Steve Purcell wrote:
> Integers are both equal *and* identical:
>
> >>> a = 1
> >>> b = 1
> >>> a is b
> 1
> >>> a == b
> 1

   Not all integers - only 0 <= i < 100:

>>> a = 217
>>> b = 217
>>> a is b
0
>>> a == b
1

   :)

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list