Newbie look at Python and OO
walterbyrd
walterbyrd at iname.com
Thu May 10 17:11:58 EDT 2007
Nevermind my previous question. I found the answer in "Learning
Python"
>>
Python internally caches and reuses short strings as an optimization,
there really is just a single string, 'spam', in memory, shared by S1
and S2; hence, the is identity test reports a true result. To trigger
the normal behavior, we need to use longer strings that fall outside
the cache mechanism:
<<
More information about the Python-list
mailing list