diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 1fa61a86dcc6ff2..d955ad2d65223d4 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1391,18 +1391,16 @@ always available. its return value is not used, so it can simply return ``None``. Error in the profile function will cause itself unset. + .. note:: + The same tracing mechanism is used for :func:`!setprofile` as :func:`settrace`. + To trace calls with :func:`!setprofile` inside a tracing function + (e.g. in a debugger breakpoint), see :func:`call_tracing`. + Profile functions should have three arguments: *frame*, *event*, and *arg*. *frame* is the current stack frame. *event* is a string: ``'call'``, ``'return'``, ``'c_call'``, ``'c_return'``, or ``'c_exception'``. *arg* depends on the event type. -.. note:: - The same tracing mechanism is used for :func:`!setprofile` as :func:`settrace`. - To trace calls with :func:`!setprofile` inside a tracing function (e.g. in a - debugger breakpoint) see :func:`call_tracing`. - -.. audit-event:: sys.setprofile "" sys.setprofile - The events have the following meaning: ``'call'`` @@ -1424,6 +1422,9 @@ always available. ``'c_exception'`` A C function has raised an exception. *arg* is the C function object. + .. audit-event:: sys.setprofile "" sys.setprofile + + .. function:: setrecursionlimit(limit) Set the maximum depth of the Python interpreter stack to *limit*. This limit