Skip to main content

PyGcTraverse

No overview available.

Methods


py_gc_traverse()

def py_gc_traverse(
visit: &PyVisit< '_ >
) - > Result< (), PyTraverseError >

Visits all references held by the object that are participating in Python's cyclic garbage collection. This method is used by the Python garbage collector to identify and break reference cycles to prevent memory leaks.

Parameters

NameTypeDescription
visit&PyVisit< '_ >The visitor object used to record references to other Python objects during the traversal process

Returns

TypeDescription
Result< (), PyTraverseError >A result indicating success or a traversal error encountered during the visit process