Google Style Python Docstrings:多类型字典

问题描述

我正在为多种类型的字典创建 Google Style Python Docstring。

单一类型的字典指定如下:

"""Takes in a dictionary.

Args:
    input (dict of str: int): The input to this fake function.
"""

如果我的字典都是字符串键,但有多个类型值怎么办。多值字典的合适文档字符串是什么?

i.e. observation_dictionary = {'veLocity': 10.25,'has_collided': False,'weather_parameter': 'rain'}

"""Takes in a dictionary
Args:
    input (dict of str: [float,bool,str]): Is this valid?
"""

额外奖励:对于具有多个键和值类型的字典,合适的文档字符串是什么?

i.e. observation_dictionary = {1: 'foo','bar': 2}

"""Takes in a dictionary
Args:
    input (dict of [str,int]: [str,int]): How about this?
"""

谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)