A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2001-March/013318.html below:

have I got it right?

[Python-Dev] nested scopes. global: have I got it right?Greg Ewing greg@cosc.canterbury.ac.nz
Thu, 01 Mar 2001 15:58:06 +1300 (NZDT)
Quoth the Samuele Pedroni:

> In particular,
> a global statement contained in an exec statement does not
> affect the code block containing the exec statement, and code
> contained in an exec statement is unaffected by global statements
> in the code containing the exec statement.

I think this is broken. As long as we're going to allow
exec-with-1-arg to implicitly mess with the current namespace,
names in the exec'ed statement should have the same meanings
as they do in the surrounding statically-compiled code.

So, global statements in the surrounding scope should be honoured
in the exec'ed statement, and global statements should be disallowed
within the exec'ed statement.

Better still, get rid of both exec-with-1-arg and locals()
altogether...

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+




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