Luke McCarthy
Luke McCarthy

Reputation: 919

Exclude __init__ parameters in sphinx autoclass output

The output generated by the sphinx autoclass directive adds the parameters for __init__ to the end of the class name. Is there any way to tell sphinx to exclude them? I need to document classes that should not be explicitly constructed, so the __init__ parameters are an internal implementation detail that should be omitted from the docs

Upvotes: 2

Views: 1307

Answers (1)

Luke McCarthy
Luke McCarthy

Reputation: 919

To answer my own question, add () to the class name, e.g.

.. autoclass:: MyClass()

Upvotes: 6

Related Questions