bpo-32532: Improve documentation of settrace and setprofile (#5359) · python/cpython@60da99b (original) (raw)

`@@ -1089,7 +1089,8 @@ always available.

`

1089

1089

` but the return event is reported even when an exception has been set). The function is

`

1090

1090

` thread-specific, but there is no way for the profiler to know about context switches between

`

1091

1091

` threads, so it does not make sense to use this in the presence of multiple threads. Also,

`

1092

``


 its return value is not used, so it can simply return ``None``.

``

1092


 its return value is not used, so it can simply return ``None``. Error in the profile

``

1093

`+

function will cause itself unset.

`

1093

1094

``

1094

1095

` Profile functions should have three arguments: frame, event, and

`

1095

1096

``` *arg*. *frame* is the current stack frame. *event* is a string: 'call',


`@@ -1173,6 +1174,9 @@ always available.

`

`1173`

`1174`

```  function for further tracing in that scope), or ``None`` to turn off tracing

1174

1175

` in that scope.

`

1175

1176

``

``

1177

`+

If there is any error occurred in the trace function, it will be unset, just

`

``

1178


 like ``settrace(None)`` is called.

``

1179

+

1176

1180

` The events have the following meaning:

`

1177

1181

``

1178

1182

``` 'call'

```