Include specific special-methods in sphinx

前端 未结 5 2090
南旧
南旧 2021-02-12 15:43

I have a bunch of classes which use \"special-methods\":

class Foo(object):
   \"Foo docstring\"

   attr1 = \"Attribute!\" #: first attribute
   attr2 = \"Anoth         


        
5条回答
  •  鱼传尺愫
    2021-02-12 16:02

    The special-members option now takes arguments (this is a new feature in Sphinx 1.2).

    So this should work:

    .. automodule:: myproject.foomodule
        :members:
        :undoc-members:
        :special-members: __contains__
        :show-inheritance:
    

提交回复
热议问题