I read somewhere (an SO post, I think, and probably somewhere else, too), that Python automatically references single character strings, so not only does 'a' == 'a', but 'a' is 'a'.
However, I can’t remember reading if this is guaranteed behavior in Python, or is it just implementation specific?
Bonus points for official sources.
It’s implementation specific. It’s difficult to tell, because (as the reference says):
The interpreter’s pretty good about ensuring they’re identical, but it doesn’t always work:
Run on CPython 2.6, this gives
True False.