Return the global debug tracing function set with sys.settrace. See the debugger chapter in the library manual.
The official docs include a CPython implementation detail for this entry.
sys/gettrace
gettrace