Python Glossary Русский

all Python 3sysfunction

sys.call_tracing()

debugging and tracing

Calls func(*args) with tracing enabled. Debugger authors need it to trace code from inside the trace function itself.

Syntax

sys.call_tracing(func, args)

While a trace function runs, tracing is switched off — otherwise it would trace itself recursively. call_tracing saves and restores that state so a debugger can debug an expression started from a breakpoint. In ordinary code it is just func(*args): note that the arguments are passed as one tuple, not unpacked.

Examples

import sys
print(sys.call_tracing(pow, (2, 10)))  # → 1024

See also

Open in the full glossarydocs.python.orgReport an inaccuracy