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

(cherry picked from commit 813db24f7c)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-03-17 17:26:07 -07:00 committed by GitHub
parent aa967ec4d4
commit 4cc9e2348b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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