【问题标题】:Function summary in Google format not showing up in the quick documentation window in PyCharmGoogle 格式的函数摘要未显示在 PyCharm 的快速文档窗口中
【发布时间】:2019-03-25 22:24:14
【问题描述】:

PyCharm 2018.3 有一个选项可以在文件 > 设置 > 工具 > Python 集成工具 > 文档字符串格式下更改您的文档字符串格式

选择“谷歌”后,我编写如下代码:

def my_func(a, b):
    """
    Do something with a and b

    Args:
        a: first arg
        b: second arg

    Returns:
        something

    """
    pass

除了要显示在快速文档窗口中的参数之外,我还想要摘要,即“用 a 和 b 做某事”,但我得到的只是这个

是我做错了什么还是 PyCharm 中的错误?

【问题讨论】:

    标签: python pycharm jetbrains-ide docstring


    【解决方案1】:

    使用 Pycharm Professional 2018.3.5 并复制您的确切示例,我无法重现该错误。 (我将此回复作为答案,因为它可以使您的研究更接近答案。)

    这是我从快速文档中得到的结果:

    def my_func(a: Any,
                b: Any) -> None
    Do something with a and b
    Params:
    a – first arg
    b – second arg
    Returns:
    something
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-21
      • 2020-02-23
      • 1970-01-01
      • 2017-06-20
      • 1970-01-01
      • 1970-01-01
      • 2017-01-10
      相关资源
      最近更新 更多