我正在尝试使用标准格式记录我的方法,但在我的搜索中,我发现了很多"标准" 记录方法的方法。我的方法是:
@staticmethod
def validateMasterAttribute(attribute):
...
根据this official Python documentation我应该这样记录:
@staticmethod
def validateMasterAttribute(attribute):
""" Validate that the entered master attribute has all the required nodes
Keyword arguments:
attribute -- type lxml.etree._Element, it is the xml node for the master attribute
Return:
Nothing if the node contains all the required sub nodes. Otherwise, it throws a TagNotFoundException exception
"""
...
然而,它是用this question写的,我应该记录它:
@staticmethod
def validateMasterAttribute(attribute):
"""
Validate that the entered master attribute has all the required nodes
:attribute: type lxml.etree._Element, it is the xml node for the master attribute
return: Nothing if the node contains all the required sub nodes. Otherwise, it throws a TagNotFoundException exception
"""
...
我还发现了另一种docstring格式,看起来很旧。 Sphinx可以解析和生成网页的格式是什么?
答案 0 :(得分:0)