Add a warning block around the get_referrers() documentation (GH-24511)

This commit is contained in:
Pablo Galindo 2021-02-15 23:03:38 +00:00 committed by GitHub
parent d0204963ec
commit 813db24f7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -135,10 +135,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.
.. function:: get_referents(*objs)