On 2/22/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > That's what rankles people about this, I think -- there > doesn't seem to be a good reason for treating the global > scope so specially, given that all scopes could be > treated uniformly if only there were an 'outer' statement. > All the arguments I've seen in favour of the status quo > seem like rationalisations after the fact.
I agree, hence my initial pre-PEP feeler on the topic ;). > > Since there were no nested lexical scopes back > > then, there was no need to have a construct for arbitrary enclosing > > scopes. > > However, if nested scopes *had* existed back then, I > rather suspect we would have had an 'outer' statement > from the beginning, or else 'global' would have been > given the semantics we are now considering for 'outer'. Would it not be so horrible to make "global" be the "outer"-type keyword--basically meaning "lexically global" versus "the global scope"? It would make the semantics for Python's nested lexical scopes to be more in line with other languages with this feature and fix my orthogonality gripes. As far as backwards compatibility, I doubt there would be too much impact in this regard, as places that would break would be where "global" was used in a closure where the name was shadowed in an enclosing scope. A "from __future__ import lexical_global" (which we'd have for adding the "outer"-like keyword anyway) could help diminish the growing pains. -Almann -- Almann T. Goo [EMAIL PROTECTED] _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com