diff options
Diffstat (limited to 'Lib/inspect.py')
| -rw-r--r-- | Lib/inspect.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index b492514..ad94ad1 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -368,6 +368,13 @@ def getdoc(object): return None if not isinstance(doc, types.StringTypes): return None + return cleandoc(doc) + +def cleandoc(doc): + """Clean up indentation from docstrings. + + Any whitespace that can be uniformly removed from the second line + onwards is removed.""" try: lines = string.split(string.expandtabs(doc), '\n') except UnicodeError: |
