Details
-
Type:
RFC
-
Status: Implemented
-
Resolution: Done
-
Component/s: DM
-
Labels:None
Description
The Developer Guide, under "Documenting Python APIs with docstrings", currently says:
The terminating """ should be on its own line, even for ‘one-line’ docstrings (this is a minor departure from PEP 257).
However, black (use of which is increasingly common) understandably enforces PEP 257 and undoes this formatting. The original intent of this divergence from PEP 257 was for convenience in later expanding the one-line docstring into multi-line documentation. Now that one of our semi-common tools disagrees with this divergence, the merits don't seem to warrant the tooling issues.
I therefore propose to replace this rule in the Developer's Guide with:
The terminating """ should be on its own line except for one-line docstrings. If the docstring is a single line, the terminating """ may be either on the same line or on its own line. (Be aware that PEP 257 requires that it be on the same line and black will enforce this rule.)
Good idea.