我应该如何使用Google风格的狮身人面像来logging列表,选项和收益?

如何使用Sphinx-Napoleon为Google样式文档中的生成器指定列表的types,可选参数和返回types?

我试过了

List[type] list of type Optional[type] type, optional 

 Yields: type: 

分别; 但是都会产生不令人满意的输出,这与生成的其他文档不一致。 例如

 Optional[type] 

只是给

可选[types]

没有任何type链接。

我试过每个内置的主题,并有相同的问题。

我应该如何用狮身人面像 – 拿破仑的Google风格的文档logging这些元素?

我知道这已经很老了,但是你看看这个例子吗? 特别是线条:

 def __init__(self, param1, param2, param3): """Example of docstring on the __init__ method. The __init__ method may be documented in either the class level docstring, or as a docstring on the __init__ method itself. Either form is acceptable, but the two should not be mixed. Choose one convention to document the __init__ method and be consistent with it. Note: Do not include the `self` parameter in the ``Args`` section. Args: param1 (str): Description of `param1`. param2 (:obj:`int`, optional): Description of `param2`. Multiple lines are supported. param3 (:obj:`list` of :obj:`str`): Description of `param3`. """ self.attr1 = param1 self.attr2 = param2 self.attr3 = param3 #: Doc comment *inline* with attribute #: list of str: Doc comment *before* attribute, with type specified self.attr4 = ['attr4'] self.attr5 = None """str: Docstring *after* attribute, with type specified."""