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/061640.html below:

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

[Python-Dev] PEP for Better Control of Nested Lexical Scopes [Python-Dev] PEP for Better Control of Nested Lexical ScopesIan Bicking ianb at colorstudy.com
Tue Feb 21 22:13:22 CET 2006
Mark Russell wrote:
> On 21 Feb 2006, at 19:25, Jeremy Hylton wrote:
> 
>>If I recall the discussion correctly, Guido said he was open to a
>>version of nested scopes that allowed rebinding.
> 
> 
> 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".

By rebinding operator, does that mean it is actually an operator?  I.e.:

   # Required assignment to declare?:
   chunk = None
   while chunk := f.read(1000):
       ...


-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org
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