[Python-Dev] Assignment to None

Terry Reedy tjreedy at udel.edu
Tue Jun 10 08:11:12 CEST 2008


""Martin v. Löwis"" <martin at v.loewis.de> wrote in message 
news:484D9435.5020907 at v.loewis.de...
|> At the global level, the subversion does not work:
|
| I think you are misinterpreting what you are seeing.

No, you didn't understand the code I posted which explicitely demonstrated 
the same point you repeated.  Again:

>>> globals()['None'] = 'ha'
>>> None
>>> dir()
['None', '__builtins__', '__doc__', '__name__', '__package__']
>>> globals()['None']
'ha'

The point of the the last two lines is that the assignment *was* made but 
was ignored in line 2 [because, obviously, the interpreter bypasses the 
normal lookup procedure].





More information about the Python-Dev mailing list