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

Function _getdoc

Lib/pydoc.py:186–200  ·  view source on GitHub ↗

Get the documentation string for an object. All tabs are expanded to spaces. To clean up docstrings that are indented to line up with blocks of code, any whitespace than can be uniformly removed from the second line onwards is removed.

(object)

Source from the content-addressed store, hash-verified

184 return None
185
186def _getdoc(object):
187 """Get the documentation string for an object.
188
189 All tabs are expanded to spaces. To clean up docstrings that are
190 indented to line up with blocks of code, any whitespace than can be
191 uniformly removed from the second line onwards is removed."""
192 doc = _getowndoc(object)
193 if doc is None:
194 try:
195 doc = _finddoc(object)
196 except (AttributeError, TypeError):
197 return None
198 if not isinstance(doc, str):
199 return None
200 return inspect.cleandoc(doc)
201
202def getdoc(object):
203 """Get the doc string or comments for an object."""

Callers 2

getdocFunction · 0.85
render_docFunction · 0.85

Calls 3

_getowndocFunction · 0.85
isinstanceFunction · 0.85
_finddocFunction · 0.70

Tested by

no test coverage detected