Wal*_*art 2 python documentation
在python中,我知道我应该像这样记录实例变量:
self.x = 22
"""docstring for x"""
#: docstring for x
self.x = 22
self.x = 22 #: docstring for x
Run Code Online (Sandbox Code Playgroud)
但我似乎无法找到一种方法来获取代码中的文档.MyClass.x.__doc__给我一个实际类型的文档x
所以,问题是:如何获得"docstring for x"从self.x?
这是Sphinx和Epydoc等文档实用程序的一个特性,而不是Python的标准功能.我不相信有任何直接的方法来获取变量docstrings.
请参见http://epydoc.sourceforge.net/manual-docstring.html#variable-docstrings
| 归档时间: |
|
| 查看次数: |
2183 次 |
| 最近记录: |