MCPcopy Index your code
hub / github.com/python/cpython / formattree

Method formattree

Lib/pydoc.py:1250–1264  ·  view source on GitHub ↗

Render in text a class tree as returned by inspect.getclasstree().

(self, tree, modname, parent=None, prefix='')

Source from the content-addressed store, hash-verified

1248 # ---------------------------------------------- type-specific routines
1249
1250 def formattree(self, tree, modname, parent=None, prefix=''):
1251 """Render in text a class tree as returned by inspect.getclasstree()."""
1252 result = ''
1253 for entry in tree:
1254 if isinstance(entry, tuple):
1255 c, bases = entry
1256 result = result + prefix + classname(c, modname)
1257 if bases and bases != (parent,):
1258 parents = (classname(c, modname) for c in bases)
1259 result = result + '(%s)' % ', '.join(parents)
1260 result = result + '\n'
1261 elif isinstance(entry, list):
1262 result = result + self.formattree(
1263 entry, modname, c, prefix + ' ')
1264 return result
1265
1266 def docmodule(self, object, name=None, mod=None, *ignored):
1267 """Produce text documentation for a given module object."""

Callers 1

docmoduleMethod · 0.95

Calls 2

classnameFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected