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/100398.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:47:26 CEST 2010
Another approach to all this might be to generalise the
mechanism by which a lookup of the globals falls back
to a lookup of __builtins__.

If this were done recursively, then the "stuff" could
be attached to the globals dict, e.g.

   stuff['__builtins__'] = __builtins__
   g = dict(__builtins__ = stuff)
   exec(code, g)
   del g['__builtins__']

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