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/2006-February/061639.html below:

[Python-Dev] PEP for Better Control of Nested Lexical Scopes

[Python-Dev] PEP for Better Control of Nested Lexical ScopesJust van Rossum just at letterror.com
Tue Feb 21 22:01:55 CET 2006
Mark Russell wrote:

> PEP 227 mentions using := as a rebinding operator, but rejects the  
> idea as it would encourage the use of closures.  But to me it seems  
> more elegant than some special keyword, especially is it could also  
> replace the "global" keyword.  It doesn't handle things like "x += y"  
> but I think you could deal with that by just writing "x := x + y".

Actually, it could handle += just fine, since that operator has written
"rebinding" all over it...

I'd be +1 on := (and augmented assignment being rebinding), but the
argument against it (if I recall correctly) was that rebinding should be
a property of the name, not of the operator. Yet "declaring" a name
local is also done trough an operator: a = 1 means a is local (unless it
was declared global). It can definitely be argued either way.

Btw, PJE's "crazy" idea (.name, to rebind an outer name) was proposed
before, but Guido wanted to reserve .name for a (Pascal-like) 'with'
statement. Hmm,
http://mail.python.org/pipermail/python-dev/2004-March/043545.html
confirms that, although it wasn't in response to a rebinding syntax. So
maybe it wasn't proposed before after all...

Just
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