From 5bcf0f31710b59593279dabd789c10529d4250e5 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Fri, 12 Feb 2021 01:11:32 +0000 Subject: [PATCH 1/2] Add a warning block around the get_referrers() documentation --- Doc/library/gc.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst index 2d85cd3431711a..5b1c2c2f0b37eb 100644 --- a/Doc/library/gc.rst +++ b/Doc/library/gc.rst @@ -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) From 932f5c0f09f9d4b9841a90bb831663dc4416d75d Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Mon, 15 Feb 2021 18:03:39 +0000 Subject: [PATCH 2/2] Update Doc/library/gc.rst Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> --- Doc/library/gc.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst index 5b1c2c2f0b37eb..a3d201d5055c8e 100644 --- a/Doc/library/gc.rst +++ b/Doc/library/gc.rst @@ -136,10 +136,10 @@ The :mod:`gc` module provides the following functions: before calling :func:`get_referrers`. .. 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. + 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)