-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
bpo-34206: Improve docs and test coverage for pre-init functions #8023
bpo-34206: Improve docs and test coverage for pre-init functions #8023
Conversation
- move the Py_Main documentation from the very high level API section to the initialization and finalization section - make it clear that it encapsulates a full Py_Initialize/Finalize cycle of its own - point out that exactly which settings will be read and applied correctly when called after a separate Py_Initialize or Py_InitalizeEx call is version dependent - be explicit that Py_IsInitialized can be called prior to initialization - actually test that Py_IsInitialized can be called prior to initialization
- also check Py_IsInitialized while the interpreter is initialized and after it is finalized - flush stdout in the embedding tests that run code so it appears in the expected order when running with "-vv" - make "-vv" on the subinterpreter embedding tests less spammy
Just noting that this is stalled pending further discussion on bpo-34008: there actually appears to be a valid use for calling |
Since bpo-34008 was resolved by restoring something close to the Python 3.6 behaviour, I filed a new issue (bpo-34206) to cover clarifying the documentation, and have retitled this PR accordingly. However, it still needs to be fixed to correctly describe the Python 3.6 and 3.7.1+ behaviour before it can be merged. |
@vstinner Reviewing my still open assigned bpo issues, I noticed this PR was still open. I think my rationale for wanting to move the docs around a bit still holds, so I'd like to merge this for 3.10 and 3.9. |
Sorry, I don't have the bandwidth to review it. |
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.
Docs look good to me. Thanks @ncoghlan.
Misc/NEWS.d/next/Documentation/2018-07-04-20-35-25.bpo-34008.bqecIb.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Documentation/2018-07-04-20-35-25.bpo-34008.bqecIb.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Thanks @ncoghlan for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, @ncoghlan, I could not cleanly backport this to
|
…ns (pythonGH-8023) - move the Py_Main documentation from the very high level API section to the initialization and finalization section - make it clear that it encapsulates a full Py_Initialize/Finalize cycle of its own - point out that exactly which settings will be read and applied correctly when Py_Main is called after a separate runtime initialization call is version dependent - be explicit that Py_IsInitialized can be called prior to initialization - actually test that Py_IsInitialized can be called prior to initialization - flush stdout in the embedding tests that run code so it appears in the expected order when running with "-vv" - make "-vv" on the subinterpreter embedding tests less spammy --------- (cherry picked from commit 7c4b6a6) Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
GH-125092 is a backport of this pull request to the 3.13 branch. |
…ns (GH-8023) (#125092) - move the Py_Main documentation from the very high level API section to the initialization and finalization section - make it clear that it encapsulates a full Py_Initialize/Finalize cycle of its own - point out that exactly which settings will be read and applied correctly when Py_Main is called after a separate runtime initialization call is version dependent - be explicit that Py_IsInitialized can be called prior to initialization - actually test that Py_IsInitialized can be called prior to initialization - flush stdout in the embedding tests that run code so it appears in the expected order when running with "-vv" - make "-vv" on the subinterpreter embedding tests less spammy --------- (cherry picked from commit 7c4b6a6) Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
to the initialization and finalization section
cycle of its own
correctly when called after a separate Py_Initialize or
Py_InitalizeEx call is version dependent
initialization
initialization
functions to the initialization and finalization section
listed as being safe to call prior to interpreter initialization
the traditional initialization API and the new struct-based one.
Closes #78387
https://bugs.python.org/issue34206