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

[Python-Dev] Explicit Lexical Scoping (pre-PEP?)

[Python-Dev] Explicit Lexical Scoping (pre-PEP?) [Python-Dev] Explicit Lexical Scoping (pre-PEP?)Phillip J. Eby pje at telecommunity.com
Wed Jul 5 17:57:03 CEST 2006
At 05:40 AM 7/5/2006 -0400, Scott Dial wrote:
>Guido van Rossum wrote:
> > Would this also use ..num to refer to num in an outer scope two levels 
> removed?
>
>I realize this was a wink, but it is a valid problem with the
>"dot"-proposal.

Actually, it isn't.  :)  See below.


>def foo(n):
>    def bar(n):
>      def baz():
>        return .n
>
>So, which 'n' outer 'n' is being referenced?

Notice that this is a made-up example.  Existing Python scoping rules don't 
allow this!  Thus your example is not a bug, it's a feature request.  And I 
say we say "no" to adding this feature.  ;-)

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