Ezio Melotti added the comment:
The fact that "is" works in this way here is just an implementation detail. If
you want to compare strings use ==, "is" is used to verify if two variables
refer to the same object or not.
>>> x = 100
>>> x is 100
True
>>> x = 1000
>>> x is 1000
False
New submission from Abhijeet Rastogi :
>>> a = u'0'
>>> a is u'0'
False
>>> a == u'0'
True
>>>
--
components: Unicode
messages: 133038
nosy: shadyabhi
priority: normal
severity: normal
status: open
title: Unicode compared using "is" results in abnormal behavior
type: behavior
versions: P