]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add a warning block around the get_referrers() documentation (GH-24511)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 18 Mar 2021 00:26:07 +0000 (17:26 -0700)
committerGitHub <noreply@github.com>
Thu, 18 Mar 2021 00:26:07 +0000 (17:26 -0700)
(cherry picked from commit 813db24f7c2c536d587d1832c3c52b44fa9e242e)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Doc/library/gc.rst

index 4558081b1dbe8baec17a883371c7ccb193840043..69a1a8313b7593104986cac131d9c189b1415cc2 100644 (file)
@@ -137,10 +137,11 @@ The :mod:`gc` module provides the following functions:
    resulting referrers.  To get only currently live objects, call :func:`collect`
    before calling :func:`get_referrers`.
 
-   Care must be taken when using objects returned by :func:`get_referrers` because
-   some of them could still be under construction and hence in a temporarily
-   invalid state. Avoid using :func:`get_referrers` for any purpose other than
-   debugging.
+   .. warning::
+      Care must be taken when using objects returned by :func:`get_referrers` because
+      some of them could still be under construction and hence in a temporarily
+      invalid state. Avoid using :func:`get_referrers` for any purpose other than
+      debugging.
 
    .. audit-event:: gc.get_referrers objs gc.get_referrers