Here are three alternatives:
-
To ensure that
__init__()is always documented, you can useautodoc-skip-memberin conf.py. Like this:def skip(app, what, name, obj, would_skip, options): if name == "__init__": return False return would_skip def setup(app): app.connect("autodoc-skip-member", skip)This explicitly defines
__init__not to be skipped (which it is by default). This configuration is specified once, and it does not require any additional markup for every class in the .rst source. -
The
special-membersoption was added in Sphinx 1.1. It makes “special” members (those with names like__special__) be documented by autodoc.Since Sphinx 1.2, this option takes arguments which makes it more useful than it was previously.
-
Use
automethod:.. autoclass:: MyClass :members: .. automethod:: __init__This has to be added for every class (cannot be used with
automodule, as pointed out in a comment to the first revision of this answer).