String Identity Test

Thomas Moore jsfrank.chen at msa.hinet.net
Tue Nov 1 08:45:56 EST 2005


Hi:

I am confused at string identity test:

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a="test"
>>> b="test"
>>> a is b
True
>>>

About identity, I think a is not b, but "a is b" returns True.
Does that mean equality and identity is the same thing for strings?





More information about the Python-list mailing list