Hi everybody,

while testing a module today I stumbled on something that I can work
around but I don't quite understand.

>>> a = "a"
>>> b = "a"
>>> a == b
True
>>> a is b
True

>>> c = "/a"
>>> d = "/a"
>>> c == d
True               # all good so far
>>> c is d
False             # eeeeek!

Why c and d point to two different objects with an identical string
content rather than the same object?

Manu
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to