mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Finished implementing gc.get_referrents(): dealt with error and end
cases, wrote docs, added a test.
This commit is contained in:
parent
fb2ab4d5ae
commit
0f81ab6d88
4 changed files with 58 additions and 7 deletions
|
@ -99,6 +99,19 @@ objects, call \function{collect()} before calling
|
|||
\versionadded{2.2}
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{get_referrents}{*objs}
|
||||
Return a list of objects directly referred to by any of the arguments.
|
||||
The referrents returned are those objects visited by the arguments'
|
||||
C-level \cfunction{tp_traverse} methods (if any), and may not be all
|
||||
objects actually directly reachable. \cfunction{tp_traverse} methods
|
||||
are supported only by objects that support garbage collection, and are
|
||||
only required to visit objects that may be involved in a cycle. So,
|
||||
for example, if an integer is directly reachable from an argument, that
|
||||
integer object may or may not appear in the result list.
|
||||
|
||||
\versionadded{2.3}
|
||||
\end{funcdesc}
|
||||
|
||||
The following variable is provided for read-only access (you can
|
||||
mutate its value but should not rebind it):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue