A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/039543.html below:

[Python-Dev] Re: Re: closure semantics

[Python-Dev] Re: Re: closure semanticsAlex Martelli aleaxit at yahoo.com
Sun Oct 26 05:37:40 EST 2003
On Sunday 26 October 2003 00:51, Greg Ewing wrote:
> > But what about name mismatches?  Global statements allows functions to
> > create 'new' variables in the module scope and not just 'existing'
> > ones.  What about for in-between scopes?
>
> It's probably a misfeature of the global statement that it allows
> that, but if we're going to re-use it in the form of a "global x in
> scope" statement, we should keep the behaviour the same for nested
> scopes in the interests of consistency.
>
> Maybe this is an argument for introducing an "outer" statement,
> which requires an existing binding (determined by existence of
> an assignment at compile time) even for the module scope, and
> deprecating "global" altogether.

I think Just's proposal of := meets all of these issues, too: it doesn't
have to, and won't, propagate global's misfeature of allowing creation
of new variables in nonlocal scope, and "requires an existing binding"
(and allows deprecating global altogether, with a warning in 2.4 etc)
in the most natural manner.


Alex


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4