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/2001-March/013314.html below:

have I got it right?

[Python-Dev] nested scopes. global: have I got it right? [Python-Dev] nested scopes. global: have I got it right?Samuele Pedroni pedroni@inf.ethz.ch
Thu, 1 Mar 2001 02:24:53 +0100
I didn't want to start a discussion, I was more concerned if I got the semantic
(that I should impl) right.
So:
  x=7
  def f():
     x=1
     def g():
       global x
       def h(): return x
       return h()
     return g()

will print 1. Ok.

regards.

PS: I tried this with a2 and python just died, I imagine, this has been fixed.





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