[pypy-dev] frame.f_trace role

anatoly techtonik techtonik at gmail.com
Thu Mar 21 20:23:03 CET 2013


Hi,

I am puzzled. The documentation mentions writable .f_trace attribute for a
frame.
"if not None, is a function called at the start of each source code line"
http://docs.python.org/2/reference/datamodel.html#types

But there is also a trace function set by sys.settrace with 'line' event
http://docs.python.org/2/library/sys.html#sys.settrace

What's the difference? Why the f_trace is needed?

It is also unclear who sets f_trace, because it should be set at the
beginning of each frame before the frame starts executing.


Why do I need it? I wanted to make a scroller for a live Python code long
ago, and now that I am deep inside Python frames (thanks to xtrace
bugreport I got earlier) it sounds like a good time for it.

The only concern I have is if 'line' event will be enough to cover all the
code that Python executes in settrace set function.
-- 
anatoly t.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20130321/37f6db43/attachment.html>


More information about the pypy-dev mailing list