How to turn a variable name into a string?

Terry Reedy tjreedy at udel.edu
Fri Mar 11 20:26:23 EST 2005


> In fact, you've got None referenced by both "my" and "c" in this
> example, and in a more complicated program None will be referenced by
> dozens symbols because it's unique [e.g. (a == None, b == None)
> necessitates (a is b) == True]

Even worse: freshly started 2.2 interpreter:
>>> sys.getrefcount(None)
216

TJR






More information about the Python-list mailing list