@@ -50,6 +50,9 @@ msgid ""
5050"the source file, or at the top of the module (see "
5151":func:`inspect.getcomments`)."
5252msgstr ""
53+ "对于模块、类、函数和方法,显示的文档内容取自对象的文档字符串(即 :attr:`!__doc__` 属性),并会递归地从其带有文档的成员中获取。 "
54+ "如果没有文档字符串,则 :mod:`!pydoc` 会尝试从源文件中类、函数或方法的定义上方,或是模块顶部的注释行代码块获取描述文本(参见 "
55+ ":func:`inspect.getcomments`。)"
5356
5457#: ../../library/pydoc.rst:30
5558msgid ""
@@ -59,6 +62,8 @@ msgid ""
5962"be viewed from outside the Python interpreter by running :program:`pydoc` as"
6063" a script at the operating system's command prompt. For example, running ::"
6164msgstr ""
65+ "内置函数 :func:`help` 会发起调用交互式解释器的在线帮助系统,该系统使用 :mod:`!pydoc` 在控制台上生成文本形式的文档内容。 "
66+ "同样的文本文档也可以在 Python 解释器以外通过在操作系统的命令提示符中以脚本方式运行 :program:`pydoc` 来查看。 例如,运行 ::"
6267
6368#: ../../library/pydoc.rst:38
6469msgid ""
@@ -83,6 +88,8 @@ msgid ""
8388"executed on that occasion. Use an ``if __name__ == '__main__':`` guard to "
8489"only execute code when a file is invoked as a script and not just imported."
8590msgstr ""
91+ "为了找到对象及其文档的内容,:mod:`!pydoc` 会导入文档所属的模块。 因而,在此情况下任何模块层级的代码都将被执行。 请使用 ``if "
92+ "__name__ == '__main__':`` 来确保特定代码仅在文件是作为脚本被发起调用而不是被导入时执行。"
8693
8794#: ../../library/pydoc.rst:54
8895msgid ""
@@ -166,6 +173,9 @@ msgid ""
166173"different URL or to a local directory containing the Library Reference "
167174"Manual pages."
168175msgstr ""
176+ "核心模块的模块文档应当位于 ``https://docs.python.org/X.Y/library/`` 其中 ``X`` 和 ``Y`` 是 "
177+ "Python 解释器的主要和次要版本号。 这可以通过将 :envvar:`!PYTHONDOCS` 环境变量设为不同的 URL "
178+ "或包含标准库参考指南页面的本地目录来覆盖。"
169179
170180#: ../../library/pydoc.rst:97
171181msgid "Added the ``-b`` option."
@@ -181,6 +191,8 @@ msgid ""
181191":func:`inspect.getfullargspec` to extract signature information from "
182192"callables."
183193msgstr ""
194+ "现在 :mod:`!pydoc` 会使用 :func:`inspect.signature` 而不是 "
195+ ":func:`inspect.getfullargspec` 来从可调用对象中提取签名信息。"
184196
185197#: ../../library/pydoc.rst:108
186198msgid "Added the ``-n`` option."
0 commit comments