为自动生成的评论更改 PyCharm 中的 reStructuredText 格式

Change reStructuredText format in PyCharm for auto-generated comments

JetBrains 的文档说,创建 reStructuredText 有两种格式 comments with type-hinting:

:param param_type param_name: parameter description (type description is on the same line as the parameter description).
:type param_name: param_type (type description is on a separate line)

曾经有一种方法,您可以 select 一种或另一种方式来生成评论,但我在 PyCharm 2017.1.2 中找不到该设置了。任何想法,这个设置在哪里?

我想在同一行中添加类型描述 param_type,但标准方法是将其放在下一行中。

它在设置 -> 工具 -> Python 集成工具 -> Docstrings -> Docstring 格式中。

如果我没理解错的话,你想要的格式是 NumPy 格式。

此外,如果您使用的是 Python>=3.5,您可能已经知道变量和函数参数中的类型提示,它看起来非常整洁,并且可以在文档字符串中保存 space: https://docs.python.org/3/library/typing.html

并且 sphinx 通过以下之一支持它们: