-
-
Notifications
You must be signed in to change notification settings - Fork 34k
gh-140550: allow slots that repeat information from PyModuleDef #144340
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
base: main
Are you sure you want to change the base?
Conversation
When integrating slots-based module creation is with the inittab, which currently requires PyModuleDef, it would be convenient to reuse the the same slots array for the MethodDef. Allow slots that match what's already present in the PyModuleDef.
|
I can confirm that with this PR the PyO3 tests all pass on my |
| the module name must be given as :c:member:`PyModuleDef.m_name`. | ||
| If the array contains slots corresponding to :c:type:`PyModuleDef` | ||
| members, the values must match. | ||
| For example, if you use :c:macro:`Py_mod_name` in :c:member:`!m_slots`; |
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.
| For example, if you use :c:macro:`Py_mod_name` in :c:member:`!m_slots`; | |
| For example, if you use :c:macro:`Py_mod_name` in :c:member:`!m_slots`, |
| #undef DEF_SLOT_CASE | ||
| #undef COPY_DEF_SLOT | ||
| #undef COPY_NONDEF_SLOT | ||
| #undef _COPY_COMMON_SLOT |
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.
| #undef _COPY_COMMON_SLOT | |
| #undef COPY_NONNULL_SLOT |
From feedback on the discussion thread:
When integrating slots-based module creation is with the inittab, which currently requires PyModuleDef, it would be convenient to reuse the the same slots array for the MethodDef.
This PR allows slots that match what's already present in the PyModuleDef.
cc @ngoldbaum
📚 Documentation preview 📚: https://cpython-previews--144340.org.readthedocs.build/