File: trim_docstring.py

package info (click to toggle)
python-graphene 3.4.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,124 kB
  • sloc: python: 8,935; makefile: 212; sh: 18
file content (9 lines) | stat: -rw-r--r-- 297 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
import inspect


def trim_docstring(docstring):
    # Cleans up whitespaces from an indented docstring
    #
    # See https://www.python.org/dev/peps/pep-0257/
    # and https://docs.python.org/2/library/inspect.html#inspect.cleandoc
    return inspect.cleandoc(docstring) if docstring else None