From b7e4f1d97c6e784d2dee182d2b81541ddcff5751 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Thu, 15 Dec 2022 04:26:08 -0700 Subject: [PATCH] GH-99767: update PyTypeObject docs for type watchers (GH-99928) --- Doc/c-api/typeobj.rst | 9 +++++++++ Doc/includes/typestruct.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 8f8869ec668..c7b318b2185 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -147,6 +147,8 @@ Quick Reference +------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+ | :c:member:`~PyTypeObject.tp_vectorcall` | :c:type:`vectorcallfunc` | | | | | | +------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+ + | :c:member:`~PyTypeObject.tp_watched` | char | | | | | | + +------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+ .. [#slots] @@ -2090,6 +2092,13 @@ and :c:type:`PyType_Type` effectively act as defaults.) .. versionadded:: 3.9 (the field exists since 3.8 but it's only used since 3.9) +.. c:member:: char PyTypeObject.tp_watched + + Internal. Do not use. + + .. versionadded:: 3.12 + + .. _static-types: Static Types diff --git a/Doc/includes/typestruct.h b/Doc/includes/typestruct.h index 02f8ccfe443..f0ad1e47cb0 100644 --- a/Doc/includes/typestruct.h +++ b/Doc/includes/typestruct.h @@ -80,4 +80,7 @@ typedef struct _typeobject { destructor tp_finalize; vectorcallfunc tp_vectorcall; + + /* bitset of which type-watchers care about this type */ + char tp_watched; } PyTypeObject;