Thomas Moore wrote:
> I am confused at string identity test:

>>>>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?

Nope:

 >>> a = 'te' + 'st'
 >>> b = 'test'
 >>> a is b
False

You're seeing a coincidence of the implementation.
--
Benji York
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to