diff options
Diffstat (limited to 'Doc/library/inspect.rst')
-rw-r--r-- | Doc/library/inspect.rst | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 7ef5d3f..a87651f 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -320,13 +320,9 @@ attributes: Retrieving source code ---------------------- - .. function:: getdoc(object) - 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. + Get the documentation string for an object, cleaned up with :func:`cleandoc`. .. function:: getcomments(object) @@ -373,6 +369,15 @@ Retrieving source code cannot be retrieved. +.. function:: cleandoc(doc) + + Clean up indentation from docstrings that are indented to line up with blocks + of code. Any whitespace that can be uniformly removed from the second line + onwards is removed. Also, all tabs are expanded to spaces. + + .. versionadded:: 2.6 + + .. _inspect-classes-functions: Classes and functions |