-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: Clarify if order of docstring sections is fixed #847
Comments
@gpshead, even just a confirmation whether google tooling currently enforces a specific order would be useful. |
yes, |
Thank you @vapier 😊 |
Out of curiosity I'd like to ask a couple things
|
while not explicitly stated, you can see example docstrings using this order in the style guide. as with the first rule, be consistent, it follows that this order is what the guide assumes. wrt Raises ordering, i understand your point about docs reflecting code flow, but i would argue that:
|
As long as it's an enforced expectation that makes me more comfortable recommending this order to others as it comes up in future PRs. And the reasoning is understandable (preferring the most common case). Thank you! |
The python style guide mentions the docstring sections
Args
,Returns/Yields
andRaises
but does not clearly specify whether their order is enforced.All examples show
Should this be taken as the only acceptable order? Or would e.g.
Raises:
beforeReturns:
be allowed?Question arose in danymat/neogen#194
The text was updated successfully, but these errors were encountered: