-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-134160: Improve multi-phase init note on isolation & subinterpreters #134775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -302,8 +302,13 @@ using :c:func:`PyModule_GetState`), or its contents (such as the module's | |
| :attr:`~object.__dict__` or individual classes created with :c:func:`PyType_FromSpec`). | ||
|
|
||
| All modules created using multi-phase initialization are expected to support | ||
| :ref:`sub-interpreters <sub-interpreter-support>`. Making sure multiple modules | ||
| are independent is typically enough to achieve this. | ||
| :ref:`sub-interpreters <sub-interpreter-support>`. | ||
| Typically, extensions ensure this in one of these ways: | ||
|
|
||
| - :ref:`isolating module instances <isolating-extensions-howto>`, | ||
| - :ref:`raising an error on repeated initialization <isolating-extensions-optout>`, or | ||
|
||
| - limiting a module to the main interpreter using | ||
| :c:data:`Py_mod_multiple_interpreters`. | ||
|
||
|
|
||
| To request multi-phase initialization, the initialization function | ||
| (PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-empty | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.