From 4ded03a0374e0672f0ae60788d907d3c4437e358 Mon Sep 17 00:00:00 2001 From: sonnyding1 Date: Wed, 9 Apr 2025 15:25:10 -0700 Subject: [PATCH 1/2] docs: add tp_versions_used member to PyTypeObject --- Doc/c-api/typeobj.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 9d551aa997ba1f..0661344a35e945 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -149,6 +149,8 @@ Quick Reference +------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+ | [:c:member:`~PyTypeObject.tp_watched`] | unsigned char | | | | | | +------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+ + | [:c:member:`~PyTypeObject.tp_versions_used`] | uint16_t | | | | | | + +------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+ .. [#slots] @@ -2229,6 +2231,19 @@ and :c:data:`PyType_Type` effectively act as defaults.) .. versionadded:: 3.12 +.. c:member:: uint16_t PyTypeObject.tp_versions_used + + Internal counter tracking the number of version tags used by this type. + + Internal. Do not use. + + **Inheritance:** + + This field is not inherited. + + .. versionadded:: 3.13 + + .. _static-types: Static Types From c4c181408fe8672f69925ef7ad4888759b3641d3 Mon Sep 17 00:00:00 2001 From: Sonny Ding <93831983+sonnyding1@users.noreply.github.com> Date: Thu, 10 Apr 2025 15:20:26 -0700 Subject: [PATCH 2/2] Update Doc/c-api/typeobj.rst Co-authored-by: sobolevn --- Doc/c-api/typeobj.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 0661344a35e945..3db0df8490f044 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -2233,8 +2233,6 @@ and :c:data:`PyType_Type` effectively act as defaults.) .. c:member:: uint16_t PyTypeObject.tp_versions_used - Internal counter tracking the number of version tags used by this type. - Internal. Do not use. **Inheritance:**