list_objs

PlasmaCalcs.tools.docs_tools.list_objs(root, types_=(<class 'module'>, <class 'function'>, <class 'method'>, <class 'type'>), *, recurse_on=(<class 'module'>, <class 'type'>), module_root=None, _seen=None)

return list of all objects in root that are instances of any of types.

root: where to start the search.

result will only contain objects defined in root or sub-modules.
(e.g. don’t list numpy objects just because numpy was imported…)
types_: tuple of types to check
only list objects which are instances of any of these types.
(trailing underscore avoids ambiguity with the types module.)
All types here must have __module__ telling module name where they were defined,
or __name__ if subclass of types.ModuleType.
recurse_on: type of types
for every obj which is an instance of recurse_on, also list_objs from that obj.
module_root: None, str, or module
only list objects defined in this module or sub-modules. E.g., ‘PlasmaCalcs.tools’.
None –> use root.__name__ (if root is module, else root.__module__
_seen: internal parameter used for recursion;
tracks which object ids have already been seen,
to ensure each obj appears in result at most 1 time.
Examples:
import PlasmaCalcs as pc
# list all modules, functions, methods, and classes in PlasmaCalcs
ll = pc.list_objs(pc)
# check that to_sphinx() works properly for all such objs in PlasmaCalcs
for obj in ll:
if obj.__doc__ is not None:
pc.DocstringInfo(obj.__doc__).to_sphinx()