class SmokeMonster(object):
"""
A large smoke monster that protects the island.
"""
def __init__(self,speed):
"""
:param speed: Velocity in MPH of the smoke monster
:type speed: int
.. document private functions
.. automethod:: _evaporate
"""
self.speed = speed
def _evaporate(self):
"""
Removes the smoke monster from reality. Not to be called by client.
"""
pass
如果您使用的是sphinx 1.1或更高版本,请访问sphinx文档站点http://www.sphinx-doc.org/en/master/ext/autodoc.html
您可以将此添加到
conf.py
文件:解决这个问题的一种方法是显式地强制Sphinx记录私有成员。可以通过将
automethod
附加到类级文档的末尾来完成此操作:相关问题 更多 >
编程相关推荐