Re: How to get a Function object from a Frame object

2005-04-22 Thread Gigi
Greg Ewing wrote: Steven Bethard wrote: Gigi wrote: I need access to a function object that corresponds to a frame object in a certain case from inside the function. Can you look up the code's co_name in the previous frame's locals? You probably also need to check the previous frame's globals...

Re: How to get a Function object from a Frame object

2005-04-19 Thread Greg Ewing
Steven Bethard wrote: Gigi wrote: I need access to a function object that corresponds to a frame object in a certain case from inside the function. Can you look up the code's co_name in the previous frame's locals? You probably also need to check the previous frame's globals... And there are pro

Re: How to get a Function object from a Frame object

2005-04-18 Thread Steven Bethard
Gigi wrote: I need access to a function object that corresponds to a frame object in a certain case from inside the function. I can get the frame object using: f = sys._getframe(0) But the resulting frame object doesn't contain the information I need. There is a lot of information in the code ob