How to override constructor parameters in Sphinx with autodoc?

后端 未结 1 1462
一个人的身影
一个人的身影 2021-01-12 22:40

Let\'s say I have a class like this:

class MyClass(object):
    \"\"\" Summary docs for my class.

    Extended documentation for my class.
    \"\"\"

    d         


        
相关标签:
1条回答
  • 2021-01-12 22:50

    I think that the best option for you is to do something like this:

    .. automodule:: mymodule
        :members:
        :exclude-members: MyClass
    
        .. autoclass:: MyClass(first, second, third)
    

    MyClass will have params overwritten and other members of mymodule will be autodocumented. You need to exclude MyClass using :exclude-members: because it will be included twice. I think it's the simplest solution at the moment.

    0 讨论(0)
提交回复
热议问题