Replies: 3 comments 5 replies
-
I believe we've more or less standardized on the google format, which I find a lot more readable than either of the others presented here. My main criticism is be that with type hints, redundantly including the type again in the "Args" line is excessively redundant. 😏 Assuming Sphinx is smart enough to understand type hints, presumably we can omit that bit of ugly? |
Beta Was this translation helpful? Give feedback.
-
My concern is that the Google format (which is probably the best of those three) is a little heavy for anything but "interface" functions. That is, for "helper" functions and similar subroutines, we should really strive to make the code self-documenting (i.e., the function name should describe its purpose, the parameter names should describe their values, and the type hints will fill in most of the rest). If what we want to be able to do is to produce externally-facing documentation from the source code, then that's fine, but we don't need that level of documentation for everything, so I would like to have the freedom to pick and choose when we need a full-blown docstring a la Google and Sphinx. In general, I would like to reserve the docstring for saying things that developers need to know in order to read or use the function; I really don't want the docstring to just reiterate stuff which is already in the function signature. I don't want our documentation requirements to get in the way of making the code accessible to the developers and reviewers. |
Beta Was this translation helpful? Give feedback.
-
+1 for |
Beta Was this translation helpful? Give feedback.
-
Can we agree on adopting the "Google" doc string formats that can be used to generate Sphinx documentation?
See the blog post, 3 Different Docstring Formats for Python.
Beta Was this translation helpful? Give feedback.
All reactions