]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Docs: Fix specifications of `gcvisitobjects_t` (#132433)
authorda-woods <dw-git@d-woods.co.uk>
Sat, 12 Apr 2025 15:36:02 +0000 (16:36 +0100)
committerGitHub <noreply@github.com>
Sat, 12 Apr 2025 15:36:02 +0000 (17:36 +0200)
`gcvisitobjects_t` callbacks should return 1 for the iteration to continue instead of 0.

Doc/c-api/gcsupport.rst

index 621da3eb069949c95cee1420b12b31411dd749b7..d1f0982b8189311215cac0cd4e400d89f5473211 100644 (file)
@@ -277,7 +277,7 @@ the garbage collector.
 
    Type of the visitor function to be passed to :c:func:`PyUnstable_GC_VisitObjects`.
    *arg* is the same as the *arg* passed to ``PyUnstable_GC_VisitObjects``.
-   Return ``0`` to continue iteration, return ``1`` to stop iteration. Other return
+   Return ``1`` to continue iteration, return ``0`` to stop iteration. Other return
    values are reserved for now so behavior on returning anything else is undefined.
 
    .. versionadded:: 3.12