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

StackOverflow

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

.. automodule:: mymodule
    :members:

and

..autoclass:: MyClass
    :members:

In conf.py, 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