-
-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Labels
Description
Leading whitespace on class comments is not stripped correctly when the first line of text is on the same line as the triple-quotes.
A class like the following:
class A:
"""This is a class.
More words here.
"""
pass
ends up having whitespace stripped to look like this:
This is a class.
More words here.
whereas this is expected:
This is a class.
More words here.
The intended behaviour is specified in PEP-257: Docstring Conventions > Handling Docstring Indentation and implemented in inspect.cleandoc
(which is called by inspect.getdoc
)
This is only a problem for classes, since elsewhere pytkdocs does use inspect.getdoc