How to use Sphinx”s autodoc to document a class”s __init__(self) method?


Sphinx doesn"t generate docs for __init__(self) by default. I have tried the following:

.. automodule:: mymodule


..autoclass:: MyClass

In, setting the following only appends the __init__(self) docstring to the class docstring (the Sphinx autodoc documentation seems to agree that this is the expected behavior, but mentions nothing regarding the problem I"m trying to solve):

autoclass_content = "both"

Get Solution for free from DataCamp guru