Mystery of Python

Skip Montanaro skip at mojam.com
Wed Feb 9 11:00:54 EST 2000


The variable char isn't interned, while the string literal "i" is.  Try:

    for char in "abcdefghijklmnopqrstuvwxyz":
	print char, sys.getrefcount(intern(char))

Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/
"Languages that change by catering to the tastes of non-users tend not to do
so well." - Doug Landauer




More information about the Python-list mailing list