Difference between 'is' and '=='

mwql mwql.aus at gmail.com
Mon Mar 27 08:28:39 EST 2006


It's really strange,

if
a = 1
b = 1
a is b ==> True

the same thing applies for strings, but not for dict, lists or tuples
I think the 'is' operator is useful for objects only, not for primitive
types, 
I think I solved the mystery behind my bugged code =)




More information about the Python-list mailing list