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/2010-May/100396.html below:

[Python-Dev] variable name resolution in exec is incorrect

[Python-Dev] variable name resolution in exec is incorrect [Python-Dev] variable name resolution in exec is incorrectGreg Ewing greg.ewing at canterbury.ac.nz
Thu May 27 05:35:35 CEST 2010
On 27/05/10 12:37, Colin H wrote:

> This is a major use
> case for exec() - defining code from strings (e.g. enabling you to
> store python code in the database), and using it at runtime. It seems
> to me this must have been the point of locals in the first place.

I suspect that originally it just fell out of the
implementation. The function in the interpreter that
executes code objects requires two namespaces as
arguments, and they were both exposed via exec just
in case anyone found a use for them.

-- 
Greg
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