numpydoc
numpydoc copied to clipboard
Inconsistent docstring format under Style Guide and Example Tab on the website
I noticed that the docstring of class Photo(ndarray)
under Style Guide tab is not consistent with the docstring of function foo
provided in the Example tab on the website.
Most of the functions in the numpy
library adapt the former style of doc-string, while PEP 257 recommends the latter. Specifically, The problem is whether or not to leave the first line blank.
I believe there's no difference after the rendering, and it is just a consistency problem. Which format is preferred?
This is just a style choice and is not officially part of the numpydoc standard --- either is equally valid. There is a docstring validation feature that will be part of the next numpydoc release that allows you to check that all of the docstrings in your project use one or the other style if it's something you want to enforce.