<div dir="ltr">Hi, is it possible to access the values stored on the stack in Python stack machine from Python?<div><br></div><div style>As in, consider expression:</div><div style><br></div><div style>tmp = foo() + bar()</div>
<div style><br></div><div style>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.</div>
<div style><br></div><div style>I would very much like to be able to read (and maybe even change) that ephemeral value.</div><div style><br></div><div style>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.</div>
<div style><br></div><div style>Thanks,</div><div style>d.</div></div>