File: trim_docstring.py

package info (click to toggle)
python-graphene 3.4.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,120 kB
  • sloc: python: 8,935; makefile: 214; sh: 18
file content (9 lines) | stat: -rw-r--r-- 297 bytes parent folder | download | duplicates (2)
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