Difference between 'is' and '=='

Benji York benji at benjiyork.com
Mon Mar 27 08:44:33 EST 2006


mwql wrote:
> It's really strange,
> 
> if
> a = 1
> b = 1
> a is b ==> True
> 
> the same thing applies for strings

Not quite:

 >>> 'abc' is 'abc'
True
 >>> 'abc' is 'ab' + 'c'
False

--
Benji York



More information about the Python-list mailing list