[Python-ideas] Conventions for Python code documentation (was: PEP 484 (Type Hints) -- first draft round)

Ben Finney ben+python at benfinney.id.au
Mon Jan 19 19:51:15 CET 2015


Cem Karan <cfkaran2 at gmail.com> writes:

> OK, so should there be a convention for writing docstrings?

The current convention is to use Sphinx to render a reStructuredText
docstring, and write the API of a class or function with
reStructuredText field lists.

    <URL:http://sphinx-doc.org/domains.html#the-python-domain>
    <URL:http://sphinx-doc.org/domains.html#info-field-lists>

Python's own documentation, as well as a large amount of third-party
packages, are written this way.

-- 
 \        “It is seldom that liberty of any kind is lost all at once.” |
  `\                                                       —David Hume |
_o__)                                                                  |
Ben Finney



More information about the Python-ideas mailing list