PyDocs

Nav

Python Language Services

get_docstring

ast

function (source)
  • get_docstring(node, clean=True)
Return the docstring for the given node or None if no docstring can
be found.  If the node provided does not have docstrings a TypeError
will be raised.

If *clean* is `True`, all tabs are expanded to spaces and any whitespace
that can be uniformly removed from the second line onwards is removed.
Changed in 3.5
  • 3.5: AsyncFunctionDef is now supported.
0 Examples
No examples for ast/get_docstring.
See Also
No see-alsos for ast/get_docstring
0 Notes
No notes for get_docstring