From: Carl Meyer Date: Thu, 15 Dec 2022 11:26:08 +0000 (-0700) Subject: GH-99767: update PyTypeObject docs for type watchers (GH-99928) X-Git-Tag: v3.12.0a4~212 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7e4f1d97c6e784d2dee182d2b81541ddcff5751;p=thirdparty%2FPython%2Fcpython.git GH-99767: update PyTypeObject docs for type watchers (GH-99928) --- diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 8f8869ec668a..c7b318b21853 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 02f8ccfe4438..f0ad1e47cb0d 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;