【问题标题】:Sphinx Napoleon Extension: document multiple return arguments with Google Style docstringsSphinx Napoleon 扩展:使用 Google Style 文档字符串记录多个返回参数
【发布时间】:2015-07-14 17:59:00
【问题描述】:

此问题与this other one 有关。建议和接受的解决方案是:

Returns:
       (tuple): tuple containing:                        
                    arg1: First Argument
                    arg2: Second Argument

这个解决方案不起作用,至少对我来说是这样。不解析带有arg1arg2 描述的缩进子块。

我应该如何使用sphinxsphinx.ext.napoleon 和 Google Style 文档字符串管理多个退货?

【问题讨论】:

  • 我认为这是post的副本。
  • 为了后代,另一个线程上的第二个未接受的答案工作正常。

标签: python python-sphinx google-style-guide sphinx-napoleon


【解决方案1】:

这是won't be fixed 的当前维护者napoleon 的一个已知问题。尽管如链接中所述,他们欢迎提供修复的拉取请求。

【讨论】:

【解决方案2】:

尝试在您的文档字符串中使用换行符\n

Returns:
    tuple: tuple containing:

        servers (list): servers to use \n
        msg (str): logging message string 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多