MCPcopy Index your code
hub / github.com/RustPython/RustPython / doc

Function doc

Lib/pydoc.py:1785–1808  ·  view source on GitHub ↗

Display text documentation, given an object or a path to an object.

(thing, title='Python Library Documentation: %s', forceload=0,
        output=None, is_cli=False)

Source from the content-addressed store, hash-verified

1783 return title % desc + '\n\n' + renderer.document(object, name)
1784
1785def doc(thing, title='Python Library Documentation: %s', forceload=0,
1786 output=None, is_cli=False):
1787 """Display text documentation, given an object or a path to an object."""
1788 if output is None:
1789 try:
1790 if isinstance(thing, str):
1791 what = thing
1792 else:
1793 what = getattr(thing, '__qualname__', None)
1794 if not isinstance(what, str):
1795 what = getattr(thing, '__name__', None)
1796 if not isinstance(what, str):
1797 what = type(thing).__name__ + ' object'
1798 pager(render_doc(thing, title, forceload), f'Help on {what!s}')
1799 except ImportError as exc:
1800 if is_cli:
1801 raise
1802 print(exc)
1803 else:
1804 try:
1805 s = render_doc(thing, title, forceload, plaintext)
1806 except ImportError as exc:
1807 s = str(exc)
1808 output.write(s)
1809
1810def writedoc(thing, forceload=0):
1811 """Write HTML documentation to a file in the current directory."""

Callers 1

helpMethod · 0.85

Calls 7

isinstanceFunction · 0.85
getattrFunction · 0.85
pagerFunction · 0.85
render_docFunction · 0.85
strFunction · 0.85
printFunction · 0.50
writeMethod · 0.45

Tested by

no test coverage detected