This is for Python 2.6.
I could not figure out why a and b are identical:
>>> a = \"some_string\"
>>> b = \"some_string\"
>>>
TIM PETERS SAID: Sorry, the only bug I see here is in the code you posted using "is" to try to determine whether two strings are equal. "is" tests for object identity, not for equality, and whether two immutable objects are really the same object isn't in general defined by Python. You should use "==" to check two strings for equality. The only time it's reliable to use "is" for that purpose is when you've explicitly interned all strings being compared (via using the intern() builtin function).
from here: http://mail.python.org/pipermail/python-bugs-list/2004-December/026772.html