Skip to content

Commit

Permalink
pythongh-99767: update PyTypeObject docs for type watchers
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Dec 1, 2022
1 parent 0563be2 commit 970b03e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ Quick Reference
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
| :c:member:`~PyTypeObject.tp_vectorcall` | :c:type:`vectorcallfunc` | | | | | |
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
| :c:member:`~PyTypeObject.tp_watched` | char | | | | | |
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+

.. [#slots]
Expand Down Expand Up @@ -2090,6 +2092,15 @@ 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
Bitset marking which of the (up to eight) registered :c:func:`type
watchers<PyType_AddWatcher>` are watching this type (via
:c:func:`PyType_Watch`.)

.. versionadded:: 3.12


.. _static-types:

Static Types
Expand Down
3 changes: 3 additions & 0 deletions Doc/includes/typestruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 970b03e

Please sign in to comment.