https://github.com/python/cpython/commit/07a6bdd76597b56f8cccc7bac1aa5c5bd42a3c20
commit: 07a6bdd76597b56f8cccc7bac1aa5c5bd42a3c20
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: ZeroIntensity <[email protected]>
date: 2025-11-11T17:28:52Z
summary:

[3.13] gh-141004: Document `PyType_Unwatch` (GH-141414) (GH-141419)

gh-141004: Document `PyType_Unwatch` (GH-141414)
(cherry picked from commit 759a048d4bea522fda2fe929be0fba1650c62b0e)

Co-authored-by: Peter Bierma <[email protected]>

files:
M Doc/c-api/type.rst

diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst
index aa7f2bca98a2f1..ae478d8c1391dd 100644
--- a/Doc/c-api/type.rst
+++ b/Doc/c-api/type.rst
@@ -116,6 +116,20 @@ Type Objects
    .. versionadded:: 3.12
 
 
+.. c:function:: int PyType_Unwatch(int watcher_id, PyObject *type)
+
+   Mark *type* as not watched. This undoes a previous call to
+   :c:func:`PyType_Watch`. *type* must not be ``NULL``.
+
+   An extension should never call this function with a *watcher_id* that was
+   not returned to it by a previous call to :c:func:`PyType_AddWatcher`.
+
+   On success, this function returns ``0``. On failure, this function returns
+   ``-1`` with an exception set.
+
+   .. versionadded:: 3.12
+
+
 .. c:type:: int (*PyType_WatchCallback)(PyObject *type)
 
    Type of a type-watcher callback function.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to