I am trying to document my method using a standard format, but in my search I found many "standard" ways of documenting methods. My method is:
@staticmethod
def validateMasterAttribute(attribute):
...
and according to this official Python documentation I should document it like this:
@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
"""
...
however, it is written in this question that I should document it like:
@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
"""
...
I also found another docstring format, which seems old. What is the format that Sphinx can parse and generate web pages from?