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

[Python-Dev] violently deprecating exec without in (was: nested scopes. global: have I got it right?)

[Python-Dev] violently deprecating exec without in (was: nested scopes. global: have I got it right?) [Python-Dev] violently deprecating exec without in (was: nested scopes. global: have I got it right?)Jeremy Hylton jeremy@alum.mit.edu
Thu, 1 Mar 2001 18:22:28 -0500 (EST)
>>>>> "SP" == Samuele Pedroni <pedroni@inf.ethz.ch> writes:

  SP> # top-level
  SP> def g():
  SP>   exec "x=3" 
  SP>   return x

At the top-level, there is no closure created by the enclosing scope
is not a function scope.  I believe that's the right thing to do,
except that the exec "x=3" also assign to the global.

I'm not sure if there is a strong justification for allowing this
form, except that it is the version of exec that is most likely to
occur in legacy code.

Jeremy



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