Skip to content

DOC Note on section ordering, and add missing sections #121

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

Merged
merged 1 commit into from
Nov 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions doc/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ facilitate reading the docstrings in text terminals.

Sections
--------
The sections of the docstring are:

The docstring consists of a number of sections separated by headings (except
for the deprecation warning). Each heading should be underlined in hyphens, and
the section ordering should be consistent with the description below.

The sections of a function's docstring are:

1. **Short summary**

Expand Down Expand Up @@ -264,7 +269,16 @@ The sections of the docstring are:
This section should be used judiciously, i.e., only for errors
that are non-obvious or have a large chance of getting raised.

9. **See Also**
9. **Warns**

An optional section detailing which warnings get raised and
under what conditions, formatted similarly to Raises.

10. **Warnings**

An optional section with cautions to the user in free text/reST.

11. **See Also**

An optional section used to refer to related code. This section
can be very useful, but should be used judiciously. The goal is to
Expand Down Expand Up @@ -303,7 +317,7 @@ The sections of the docstring are:
func_b, func_c_, func_d
func_e

10. **Notes**
12. **Notes**

An optional section that provides additional information about the
code, possibly including a discussion of the algorithm. This
Expand Down Expand Up @@ -348,7 +362,7 @@ The sections of the docstring are:
where filename is a path relative to the reference guide source
directory.

11. **References**
13. **References**

References cited in the **notes** section may be listed here,
e.g. if you cited the article below using the text ``[1]_``,
Expand All @@ -373,7 +387,7 @@ The sections of the docstring are:
should not be required to understand it. References are numbered, starting
from one, in the order in which they are cited.

12. **Examples**
14. **Examples**

An optional section for examples, using the `doctest
<http://docs.python.org/library/doctest.html>`_ format.
Expand Down