From 65eda05b4433bd2989c13123e30cd9462e3405cf Mon Sep 17 00:00:00 2001 From: da-woods Date: Sat, 12 Apr 2025 12:29:08 +0100 Subject: [PATCH] Fix documentation for gcvisitobjects_t Documented behaviour is the exact opposite of the real behaviour. See comment in the code https://github.com/python/cpython/blob/ad3bbe8fbcc9045c436b0c5e49b1aec018c59c2d/Include/cpython/objimpl.h#L92-L93 and code https://github.com/python/cpython/blob/ad3bbe8fbcc9045c436b0c5e49b1aec018c59c2d/Python/gc.c#L2405 --- Doc/c-api/gcsupport.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/gcsupport.rst b/Doc/c-api/gcsupport.rst index 621da3eb069949..d1f0982b818931 100644 --- a/Doc/c-api/gcsupport.rst +++ b/Doc/c-api/gcsupport.rst @@ -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