What are these tags @ivar @param and @type in python docstring?

℡╲_俬逩灬. 提交于 2019-12-12 08:19:59

问题


The ampoule project uses some tags in docstring, like the javadoc ones.

For example from pool.py line 86:

def start(self, ampChild=None):
    """
    Starts the ProcessPool with a given child protocol.

    @param ampChild: a L{ampoule.child.AMPChild} subclass.
    @type ampChild: L{ampoule.child.AMPChild} subclass
    """

What are these tags, which tool uses it.


回答1:


Markup for a documentation tool, probably epydoc.




回答2:


Just for fun I'll note that the Python standard library is using Sphinx/reStructuredText, whose info field lists are similar.

def start(self, ampChild=None):
    """Starts the ProcessPool with a given child protocol.

    :param ampChild: a :class:`ampoule.child.AMPChild` subclass.
    :type ampChild: :class:`ampoule.child.AMPChild` subclass
    """


来源:https://stackoverflow.com/questions/379346/what-are-these-tags-ivar-param-and-type-in-python-docstring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!