graphene/graphene/utils/trim_docstring.py
Wei Yen 0dc8e57c50 Implement trim_docstring
Thin wrapper around `inspect.clean_doc`
2017-02-22 07:03:30 +11:00

10 lines
297 B
Python

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