Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/360.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在Google风格的docstring中列出多接口函数的*参数?_Python_Python 3.x_Python Sphinx_Variadic Functions_Docstring - Fatal编程技术网

Python 如何在Google风格的docstring中列出多接口函数的*参数?

Python 如何在Google风格的docstring中列出多接口函数的*参数?,python,python-3.x,python-sphinx,variadic-functions,docstring,Python,Python 3.x,Python Sphinx,Variadic Functions,Docstring,我有以下功能,不知道如何正确记录其多个接口: def log(self, *args): """Logs data in-memory to a list container, associated with a unix-path-like key. Args: **either** vpath (str): Virtual path value (Any): Value to store

我有以下功能,不知道如何正确记录其多个接口:

def log(self, *args):
    """Logs data in-memory to a list container, associated with a unix-path-like key.

    Args:
        **either**
        vpath (str): Virtual path
        value (Any): Value to store
        **or**
        vpath_value_map (Dict[str, Any]): Mapping of vpaths and values to store

    Raises:
        TypeError -- Wrong number of arguments.
    """
    if not (0 < len(args) < 3):
        raise TypeError("Method has to be called with either one or two arguments.")
def日志(self,*args):
“”“将内存中的数据记录到一个列表容器中,该容器与类似unix路径的键相关联。
Args:
**或者**
vpath(str):虚拟路径
值(任意):要存储的值
**或**
vpath_value_map(Dict[str,Any]):要存储的vpath和值的映射
提出:
TypeError——参数数目错误。
"""
如果不是(0
我想坚持谷歌风格,理想情况下斯芬克斯应该与之合作。
谢谢您的帮助。

我的建议是在文档字符串中添加一个清晰的段落。类似这样的内容:“该函数接受一个(
vpath\u value\u map
)或两个(
vpath
value
)位置参数。”我的建议是简单地在docstring中添加一个澄清段落。类似这样的内容:“该函数接受一个(
vpath\u value\u map
)或两个(
vpath
value
)位置参数。”