[Python-Dev] Accessing value stack

Dima Tisnek dimaqq at gmail.com
Mon Jan 7 15:06:51 CET 2013


Hi, is it possible to access the values stored on the stack in Python stack
machine from Python?

As in, consider expression:

tmp = foo() + bar()

At the point in time when bar() is called, foo() already returned
something, and that value is on top of the stack in that frame, a few steps
after bar() returns, that value is added to bar and is lost.

I would very much like to be able to read (and maybe even change) that
ephemeral value.

If it is absolutely not possible to achieve from Pythonland, I welcome
pointers on how to write a C/cython/types extension to achieve this.

Thanks,
d.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130107/d7987c12/attachment.html>


More information about the Python-Dev mailing list