> It takes far too little evidence to induce belief: > > >>> a = "hello" > >>> b = "h"+"ello" > >>> a is b > False > >>> c = "hello" > >>> b is a > False > >>>
I don't understand the point of your last expression. Were you intending this instead: >>> c is a True However, the following commands add to my confusion: >> a = 'wtf?' >> b = 'wtf?' >> a is b False So how are string literals cached? Is there an explanation somewhere? Is it some freaky voodoo, and I should just assume that a string literal will always generate a new object? Thanks, Farshid -- http://mail.python.org/mailman/listinfo/python-list