How to stop sethinx automethod prefix method name with class name

When I use Sethinx automethod to document a specific method, for example:

.. automethod:: my_module.MyClass.my_method

As a result, the documents add the class name to the method name as follows:

MyClass.my_method(kwarg1=None, kwarg2=None)

    This is the docstring for my_method...

Is there a way to tell automethod not the prefix of the method name with the class name, so the resulting documents look like this:

my_method(kwarg1=None, kwarg2=None)

    This is the docstring for my_method...

?

+4
source share
1 answer

Add this line to your conf.pyfile

add_module_names = False

+1
source

Source: https://habr.com/ru/post/1609561/


All Articles