I have written a trace function and it recieves the current frame
object from the interpreter.
I want to know whether the event pertains to a class or method or function.
I can only get a code object from this frame object but not a function
object or class object.
Please post if any body have
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...
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
Hi,
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 object
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