Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
sonnyding1 wants to merge3 commits intopython:main
base:main
Choose a base branch
Loading
fromsonnyding1:doc_tp_versions_used
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletionsDoc/c-api/typeobj.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,6 +149,8 @@ Quick Reference
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
| [:c:member:`~PyTypeObject.tp_watched`] | unsigned char | | | | | |
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
| [:c:member:`~PyTypeObject.tp_versions_used`] | uint16_t | | | | | |
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+

.. [#slots]

Expand DownExpand Up@@ -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.

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?

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).

sonnyding1 reacted with thumbs up emoji

**Inheritance:**

This field is not inherited.

.. versionadded:: 3.13


.. _static-types:

Static Types
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp