File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -763,14 +763,14 @@ deleted. This can be done using interpreter views.
763763
764764 On success, this function returns a view to the main
765765 interpreter; on failure, it returns ``NULL `` without an exception set.
766- Failure indicates that the process is out of memory or that the main
767- interpreter has finalized (or never existed).
768-
769- Using this function in extension libraries is strongly discouraged, because
770- it typically compromises the library's subinterpreter support. It exists
771- for exceptional cases where there is no other option (such as when a native
772- threading library doesn't provide a `` void *arg `` parameter that could be
773- used to store a `` PyInterpreterGuard `` or `` PyInterpreterView `` pointer) .
766+ Failure indicates that the process is out of memory.
767+
768+ Use this function when an interpreter pointer or view cannot be supplied
769+ by the caller, such as when a native threading library does not provide a
770+ `` void *arg `` parameter that could carry a :c:type: ` PyInterpreterGuard ` or
771+ :c:type: ` PyInterpreterView `. In code that supports subinterpreters, prefer
772+ :c:func: ` PyInterpreterView_FromCurrent ` so the guard tracks the calling
773+ interpreter rather than the main one .
774774
775775 The caller does not need to hold an :term: `attached thread state `.
776776
You can’t perform that action at this time.
0 commit comments