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/061718.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 ScopesTerry Reedy tjreedy at udel.edu
Wed Feb 22 20:09:41 CET 2006
"Almann T. Goo" <almann.goo at gmail.com> wrote in message 
news:7e9b97090602212336ka0b5fd8r2c85b1c0e914aff1 at mail.gmail.com...
> IMO, Having properly nested scopes in Python in a sense made having
> closures a natural idiom to the language and part of its "user
> interface."  By not allowing the name re-binding it almost seems like
> that "user interface" has a rough edge that is almost too easy to get
> cut on.

I can see now how it would look that way to someone who has experience with 
fully functional nested scopes in other languages and who learns Python 
after no-write nested scoping was added.  What is not mentioned in the ref 
manual and what I suppose may not be obvious even reading the PEP is that 
Python added nesting to solve two particular problems.  First was the 
inability to write nested recursive functions without the hack of stuffing 
its name in the global namespace (or of patching the byte code).  Second 
was the need to misuse the default arg mechanism in nested functions.  What 
we have now pretty well fixes both.

Terry Jan Reedy



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