记录函数参数和类属性类型的标准方法是什么,以区分预期是类实例的函数参数和类属性本身是类对象的类型?在
class TestClass(object):
def __init__(self):
pass
class Objectify(object):
def __init__(self):
pass
class NeatDocumentation(object):
"""A class demonstrating neat documentation style.
Attributes:
cls (TestClass?): A class you want to test.
obj (Objectify?): An instance of `Objectify` class.
string (str): A string because why not.
"""
def __init__(self, cls_, obj, string):
self.cls = cls_ # An instance can be created by executing self.cls()
self.obj = obj
self.string = string
python标准是使用restructedText(http://www.sphinx-doc.org/en/1.4.9/rest.html)的sphinx样式
更准确地说,autodoc模块样式:http://www.sphinx-doc.org/en/1.4.8/ext/autodoc.html
如果你想拥有更漂亮的琴弦,你也可以使用斯芬克斯拿破仑风格: http://www.sphinx-doc.org/en/1.4.9/ext/napoleon.html
在您的情况下,您可以:
或者使用拿破仑:
^{pr2}$相关问题 更多 >
编程相关推荐