Do not recommend a blank line before any docstrings. Patch by Akira Kidata.

This commit is contained in:
Guido van Rossum 2014-10-24 09:31:53 -07:00
parent c2a5db92b0
commit eba2eac2ea
1 changed files with 4 additions and 10 deletions

View File

@ -140,16 +140,10 @@ the same line as the opening quotes or on the next line. The entire
docstring is indented the same as the quotes at its first line (see docstring is indented the same as the quotes at its first line (see
example below). example below).
Insert a blank line before and after all docstrings (one-line or Insert a blank line after all docstrings (one-line or multi-line) that
multi-line) that document a class -- generally speaking, the class's document a class -- generally speaking, the class's methods are
methods are separated from each other by a single blank line, and the separated from each other by a single blank line, and the docstring
docstring needs to be offset from the first method by a blank line; needs to be offset from the first method by a blank line.
for symmetry, put a blank line between the class header and the
docstring. Docstrings documenting functions or methods generally
don't have this requirement, unless the function or method's body is
written as a number of blank-line separated sections -- in this case,
treat the docstring as another section, and precede it with a blank
line.
The docstring of a script (a stand-alone program) should be usable as The docstring of a script (a stand-alone program) should be usable as
its "usage" message, printed when the script is invoked with incorrect its "usage" message, printed when the script is invoked with incorrect