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/2009-February/086337.html below:

[Python-Dev] code.interact() locals + globals?

[Python-Dev] code.interact() locals + globals? [Python-Dev] code.interact() locals + globals?Rocky Bernstein rocky at gnu.org
Sun Feb 22 00:20:26 CET 2009
I notice  code.interact() in Python 2.6 has a parameter for locals but not
globals. Should it?

Ultimately,  *exec* is used underneath so I don't see a technical reason why
it couldn't add a global parameter. Also, although one could pass in a
dictionary that is the merger or update() of locals() and globals(),  this
has a couple of downsides.

First, if the intention is to allow update of local and global variables,
combining the two into a single dictionary wreaks havoc. Even if one doesn't
care about this, when the underlying *exec* is performed it will see
different and wrong values for the functions locals() and globals() among
other problems of this kind.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20090221/8089650b/attachment-0001.htm>
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