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/2007-February/070885.html below:

[Python-Dev] Changing a value in a frame (for a debugger)

[Python-Dev] Changing a value in a frame (for a debugger) [Python-Dev] Changing a value in a frame (for a debugger)Greg Ewing greg.ewing at canterbury.ac.nz
Wed Feb 7 07:13:39 CET 2007
Fabio Zadrozny wrote:

> frame = findFrame(thread_id, frame_id)
> exec '%s=%s' % (attr, expression) in frame.f_globals, frame.f_locals

The locals of a function are actually stored in an array.
When you access them as a dict using locals(), all you
get is a dict containing a copy of their current values.
Modifying that dict doesn't affect the underlying array.

It seems that reading the f_locals of a frame does the
same thing. To modify the locals, you would need to poke
values into the original array -- but it doesn't seem
to be exposed to Python.

So it looks like you're out of luck.

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