-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-134160: Use multi-phase init in documentation examples #134296
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8d8b366
Update docs
neonene 88c5f3f
Don't change an unrelated example
neonene a4ade5c
Apply suggestions from code review
neonene d6c42e2
ditto
neonene 97eae13
Suggested module names
neonene 8ae6bae
Avoid modernization
neonene bc78288
typo
neonene c3ab022
Correction: "error"
neonene d65303c
Rephrase warning
neonene aec6781
keywdarg_module
neonene 7dfd5ad
Update Doc/extending/extending.rst
neonene f7c72dd
Indicate xxlimited
neonene c84638c
Add seealso to index
neonene 4e59e88
Update Doc/extending/embedding.rst
neonene d68e3e3
ditto (for copy-paste)
neonene f6465bd
Shrink slots
neonene 1a65816
Remove module states
neonene a83e266
Correction: "SpamError"
neonene 2d10958
Add a Py_mod_multiple_interpreters slot
neonene a28e67c
Cancel the prvious addition as needless
neonene 9e6bff5
Merge remote-tracking branch 'upstream/main' into multi
AA-Turner d35a6b4
updates
AA-Turner 9cb3092
PEP 7
AA-Turner 6e5b1c5
revert module state for SpamError
AA-Turner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Having done trial conversions of NumPy to multi-phase, I think we should include the relevant PY_VERSION_HEX checks. Both Py_mod_multiple_interpreters and Py_mod_gil were added very recently.
If we agree on adding these checks, we should add them for all relevant PyModuleDef_Slot structs. It is verbose, but aids in the copy-and-paste scenario.
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.
Alternative:
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.
Can this PR omit these slots entirely?
IMO, they should be introduced later, after you compile your first module, along with a longer discussion about isolated state & thread safety.
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.
Agree better to keep simple. @neonene perhaps remove the gil and interpreter slots from where we've added them in this PR unless they were already present?
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.
Removed, but not all. I can complete.