Whre is my object ??
mr.kuta at libero.it
Tue Jun 3 23:42:57 CEST 2003
Ok, a little riddle for he Python community.
Follow this code (interactive):
>>> class marco:
>>> del marco
<class __builtin__.marco at 0x023824D8>
>>> objlist.me =23
honInterpreter.py", line 69, in push
exec code in self.locals
File "<console>", line 1, in ?
'''exceptions.NameError : name 'marco' is not defined'''
Evidently "marco" object does not exist in the utermost scope (__builtin__
but it exit "inside" the list object and can be not only referenced but
So where is my object? (apart from the obvious mem location at 0x023824D8)
Does it have a scope in which it exist ?
Do list "create" a scope?
Is it another riddle on identifiers?
More information about the Python-list