]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-141004: Document `PyType_Unwatch` (GH-141414) (GH-141419)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 11 Nov 2025 17:28:52 +0000 (18:28 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Nov 2025 17:28:52 +0000 (17:28 +0000)
gh-141004: Document `PyType_Unwatch` (GH-141414)
(cherry picked from commit 759a048d4bea522fda2fe929be0fba1650c62b0e)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Doc/c-api/type.rst

index aa7f2bca98a2f19b152dbba946630a89327bfd98..ae478d8c1391dde32131a04ddc5ec9e103c1cbe9 100644 (file)
@@ -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.