autodoc

Sphinx decorated classes not documented

风格不统一 提交于 2020-08-11 05:34:21
问题 I'm documenting my library with Sphinx. And I have decorator logic_object : class logic_object: """Decorator for logic object class. """ def __init__(self, cls): self.cls = cls self.__doc__ = self.cls.__doc__ And I have gravity class that decorated by logic_object : @logic_object class gravity: """Basic gravity object logic class. :param float g: pixels of acceleration :param float jf: jump force """ #There is more not important code. My Sphinx .rst file is: Mind.Existence ===================

How use :private-members: to show mangled member value constants in Sphinx

隐身守侯 提交于 2020-07-22 21:35:33
问题 How can I get the value of a constant into my Sphinx documentation? .. automodule:: mymodule :members: :private-members: This is my test module: class Test: """My Test Class""" __MY_TEST_CONSTANT = 98.2 """My test constant docu""" At the moment I get the description of my private constant but the value is "None" and not "98.2". class Test: My Test Class __MY_TEST_CONSTANT = None My test constant docu 回答1: I tested this and I'm pretty sure it's either: an undocumented feature, a bug, or both.

How use :private-members: to show mangled member value constants in Sphinx

☆樱花仙子☆ 提交于 2020-07-22 21:35:00
问题 How can I get the value of a constant into my Sphinx documentation? .. automodule:: mymodule :members: :private-members: This is my test module: class Test: """My Test Class""" __MY_TEST_CONSTANT = 98.2 """My test constant docu""" At the moment I get the description of my private constant but the value is "None" and not "98.2". class Test: My Test Class __MY_TEST_CONSTANT = None My test constant docu 回答1: I tested this and I'm pretty sure it's either: an undocumented feature, a bug, or both.