In functions and methods with only a docstring, it is stylistically considered redundant to include a pass statement. See the pylint issue requesting the Unnecessary pass warning. However, PEP257 states, "There’s no blank line either before or after the docstring." Thus, in the following code snippet, the newline before the second function will be removed by docformatter which causes pylint to raise the W0107 warning (see here).
def a_function():
"""Here we have a stub function that does ugatz."""
def b_function():
"""Here we have the next function separated from the first by a newline.
We want the newline to remain in place, but currently docformatter
removes it because it sees the def statement as the next line of code.
"""
Currently, including a pass statement in a_function will cause docformatter to retain the newline, However, docformatter should recognize a_function as a stub and retain the newline without the use of a pass statement.
In functions and methods with only a docstring, it is stylistically considered redundant to include a
pass
statement. See the pylint issue requesting the Unnecessary pass warning. However, PEP257 states, "There’s no blank line either before or after the docstring." Thus, in the following code snippet, the newline before the second function will be removed by docformatter which causes pylint to raise the W0107 warning (see here).Currently, including a
pass
statement in a_function will cause docformatter to retain the newline, However, docformatter should recognize a_function as a stub and retain the newline without the use of apass
statement.