[Python-Dev] closure semantics

David Ascher DavidA at ActiveState.com
Wed Nov 5 22:44:43 EST 2003


Guido van Rossum wrote:

[Alex]
>>>So it can't be global, as it must stay a keyword for backwards
>>>compatibility at least until 3.0.

[David]
>>Why?  Removing keywords should be much simpler than adding them.  I
>>have no idea how hard it is to hack the parser to adjust, but I
>>can't imagine how having 'global' no longer be a keyword as far as
>>its concerned break b/w compatibility.
>>
>>What am I missing?

[GvR]
> I don't recall the context, but I think the real issue with removing
> 'global' is that there's too much code out there that uses the global
> syntax to remove the global statement before 3.0.

I would never have suggested that.  Just that we can evolve the parser
to retain the old usage

	global a,b,c

while allowing a new usage

	global.a = value

by removing 'global' from the list of reserved words and doing "fancy
stuff" in the parser.  Note that I very much don't know the details
of the "fancy stuff".

--david





More information about the Python-Dev mailing list