Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-132331: Addtp_versions_used
toPyTypeObject
docs#132335
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 ourterms of service andprivacy 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
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: sobolevn <mail@sobolevn.me>
python-cla-botbot commentedApr 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@@ -2229,6 +2231,17 @@ and :c:data:`PyType_Type` effectively act as defaults.) | |||
.. versionadded:: 3.12 | |||
.. c:member:: uint16_t PyTypeObject.tp_versions_used | |||
Internal. Do not use. |
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.
Why should we document something, just to tell people not to use 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.
This field is exposed to the user who may use local PyTypeObject instances that are statically initialized (the LinuxCNC project implements that use case several places). If you do not initialize this field, then you get a warningmissing initializer for member '_typeobject::tp_versions_used'
.
Therefore, it should be documented (and it needs to be set to zero when statically initialized).
Uh oh!
There was an error while loading.Please reload this page.
Fixes#132331. Add
tp_versions_used
to thetp slots section, as well as a description of the field itself. I've read through#113462 and its corresponding PR to understand how this field came about, but please let me know if there are any inaccuracies, thanks!tp_versions_used
was added toPyTypeObject
but is not documented #132331📚 Documentation preview 📚:https://cpython-previews--132335.org.readthedocs.build/