Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,17 @@ always available.
Note that as an exception is propagated down the chain of callers, an
``'exception'`` event is generated at each level.

For more fine-grained usage, it's possible to set a trace function by
assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on
it being set indirectly via the return value from an already installed
trace function. This is also required for activating the trace function on
the current frame, which :func:`settrace` doesn't do. Note that in order
for this to work, a global tracing function must have been installed
with :func:`settrace` in order to enable the runtime tracing machinery,
but it doesn't need to be the same tracing function (e.g. it could be a
low overhead tracing function that simply returns ``None`` to disable
itself immediately on each frame).

For more information on code and frame objects, refer to :ref:`types`.

.. impl-detail::
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Mention ``frame.f_trace`` in :func:`sys.settrace` docs.