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

[Python-Dev] Re: Re: closure semantics

[Python-Dev] Re: Re: closure semantics [Python-Dev] Re: Re: closure semanticsTerry Reedy tjreedy at udel.edu
Fri Oct 24 13:16:41 EDT 2003
"Terry Reedy" <tjreedy at udel.edu> wrote in message
news:bnbm8s$p6h$1 at sea.gmane.org...
>
> 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?
>
> #start of fress interpreter session
> def f():
>   global xf
>   xf = 1
>   def g()
>     global xg
>     xg = 2
>     global xgf in f
>     xgf = 3
>
> does this compile and run?  or choke on third global at compile
time?
> or choke on third assignment at runtime?

Whoops.
Paul Moore asked same question and Guido answered compile and run.

TJR




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