Document how autodoc with attributes works.

This commit is contained in:
Georg Brandl
2009-01-06 00:28:29 +01:00
parent 5881e534f1
commit 34a08b862e

View File

@@ -135,12 +135,30 @@ directive.
.. directive:: autofunction
autodata
automethod
autoattribute
These work exactly like :dir:`autoclass` etc., but do not offer the options
used for automatic member documentation.
For module data members and class attributes, documentation can either be put
into a special-formatted comment *before* the attribute definition, or in a
docstring *after* the definition. This means that in the following class
definition, both attributes can be autodocumented::
class Foo:
"""Docstring for class Foo."""
#: Doc comment for attribute Foo.bar.
bar = 1
baz = 2
"""Docstring for attribute Foo.baz."""
.. versionchanged:: 0.6
:dir:`autodata` and :dir:`autoattribute` can now extract docstrings.
.. note::
If you document decorated functions or methods, keep in mind that autodoc