|View source on GitHub|
Recursively enumerate all members of
tfdocs.traverse.traverse( root, filters, accumulator, root_name ) -> None
Similar to the Python library function
Traverses the tree of Python objects starting with
root, depth first.
Parent-child relationships in the tree are defined by membership in modules or
classes. The function
visit is called with arguments
(path, parent, children) for each module or class
parent found in the tree
of python objects starting with
path is a string containing the name
parent is reachable from the current context. For example, if
root is a local class called
X which contains a class
visit will be
('Y', X.Y, children)).
root is not a module or class,
visit is never called.
never descends into built-in modules.
children, a list of
(name, object) pairs are determined by
inspect.getmembers. To avoid visiting parts of the tree,
be modified in place, using
del or slice assignment.
Cycles (determined by reference equality,
is) stop the traversal. A stack of
objects is kept to find cycles. Objects forming cycles may appear in
visit will not be called with any object as
is already in the stack.
Traversing system modules can take a long time, it is advisable to pass a
visit callable which denylists such modules.