On Mon, Jan 7, 2013 at 11:32 AM, Brett Cannon firstname.lastname@example.org wrote:
On Mon, Jan 7, 2013 at 10:46 AM, Maciej Fijalkowski email@example.com wrote:
On Mon, Jan 7, 2013 at 4:22 PM, Oleg Broytman firstname.lastname@example.org wrote:
On Mon, Jan 07, 2013 at 03:06:51PM +0100, Dima Tisnek email@example.com wrote:
Hi, is it possible to access the values stored on the stack in Python stack machine from Python?
In short: it's possible but very much discouraged. Don't hack into python internals.
Is it possible? I claim it's not (from *Python* because obviously data is in memory).
Nope, it's not.
I took that as a challenge, and just tried to do it using gc.get_referents(). ;-)
Didn't work though... which actually makes me wonder if that's a bug in gc.get_referents(), or whether I'm making a bad assumption about when you'd have to run gc.get_referents() on a frame in order to see items from the value stack included. Could this actually be a bug in frames' GC implementation, or are value stack items not supposed to count for GC purposes?