【发布时间】:2020-08-18 14:38:59
【问题描述】:
VSCode 从哪里获取文档字符串签名?我在设置中找不到任何相关部分。
在我的安装中,很明显 VSCode 没有使用来自 __doc__ 属性的签名。
我想查看__doc__(或将其设置为pydoc 的输出),但我得到如下内容
这是我从__doc__ 或pydoc 得到的签名
print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)
【问题讨论】:
-
In: print.__doc__Out: "print(value, ..., sep=' ', end='\\n', file=sys.stdout, flush=False)\n\nPrints the values to a stream, or to sys.stdout by default.\nOptional keyword arguments:\nfile: a file-like object (stream); defaults to the current sys.stdout.\nsep: string inserted between values, default a space.\nend: string appended after the last value, default a newline.\nflush: whether to forcibly flush the stream."这是我从print.__doc__得到的。也许 VSCode 正在使用不同的 python 安装? -
@PranavHosangadi 是的,我已经检查过了,我使用相同的 Python 解释器 VSCode 设置为 (/usr/local/bin/python3)。当您将鼠标悬停在 VSCode 中时,您会得到与 print.__doc__ 相同的输出还是得到类似我的屏幕截图的输出?
-
它是什么版本的 Python?可能是特定于版本或平台的东西?
-
@PranavHosangadi 我尝试了两种不同的系统,一种是 3.6,另一种是 3.7,结果相同。
标签: python-3.x visual-studio-code docstring