44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66# Translators:
7- # Freesand Leo <[email protected] >, 20248- # Unknownuserfrommars, 2024
97# Rafael Fontenelle <[email protected] >, 20248+ # Unknownuserfrommars, 2024
9+ # Freesand Leo <[email protected] >, 20241010#
1111#, fuzzy
1212msgid ""
@@ -15,7 +15,7 @@ msgstr ""
1515"Report-Msgid-Bugs-To : \n "
1616"POT-Creation-Date : 2024-05-31 14:49+0000\n "
1717"PO-Revision-Date : 2024-05-11 00:34+0000\n "
18- "Last-Translator : Rafael Fontenelle <rffontenelle@gmail .com>, 2024\n "
18+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2024\n "
1919"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2020"MIME-Version : 1.0\n "
2121"Content-Type : text/plain; charset=UTF-8\n "
@@ -637,6 +637,9 @@ msgid ""
637637"to use a proxy will cause a :exc:`!weakref.ReferenceError` exception to be "
638638"raised. ::"
639639msgstr ""
640+ ":mod:`weakref` 模块还允许创建代理对象,代理对象的行为类似于弱引用--"
641+ "仅被代理对象引用的对象会被解分配,但只要对象仍然存在,代理就会透明地将所有操作转发给对象,而不需要显式调用来检索对象。 "
642+ "如果对象已被解分配,尝试使用代理将引发:exc:`!weakref.ReferenceError` 异常:"
640643
641644#: ../../whatsnew/2.1.rst:416
642645msgid ":pep:`205` - Weak References"
@@ -683,6 +686,9 @@ msgid ""
683686"Python dictionary; you *can't* be tricky and set it to a :class:`!UserDict` "
684687"instance, or any other random object that behaves like a mapping."
685688msgstr ""
689+ "包含属性的字典可以作为函数的 :attr:`~object.__dict__` 访问。 与类实例的 :attr:`~object.__dict__` "
690+ "属性不同,在函数中,您实际上可以为 :attr:`~object.__dict__` 分配一个新的字典,尽管新值仅限于普通的 Python 字典;您 "
691+ "*不能* 狡猾地将其设置为 :class:`!UserDict` 实例,或任何其他行为类似映射的随机对象。"
686692
687693#: ../../whatsnew/2.1.rst:455
688694msgid ":pep:`232` - Function Attributes"
@@ -703,6 +709,8 @@ msgid ""
703709"distinguish the filenames ``FILE.PY`` and ``file.py``, even though they do "
704710"store the file's name in its original case (they're case-preserving, too)."
705711msgstr ""
712+ "一些操作系统的文件系统是区分大小写的,MacOS 和 Windows 是主要的例子;在这些系统上,无法区分文件名 ``FILE.PY`` 和 "
713+ "``file.py``,尽管它们确实以原始大小写存储文件名(它们也是区分大小写的)"
706714
707715#: ../../whatsnew/2.1.rst:469
708716msgid ""
@@ -714,6 +722,10 @@ msgid ""
714722":envvar:`PYTHONCASEOK` environment variable before starting the Python "
715723"interpreter."
716724msgstr ""
725+ "在 Python 2.1 中,:keyword:`import` 语句可以在不区分大小写的平台上模拟大小写敏感性。 现在,Python "
726+ "默认搜索第一个大小写敏感匹配的文件,如果找不到这样的文件,就会引发 :exc:`ImportError`,因此 ``import file`` "
727+ "不会导入名为 ``FILE.PY`` 的模块。 在启动 Python 解释器之前,可以通过设置 :envvar:`PYTHONCASEOK` "
728+ "环境变量来请求大小写不敏感匹配。"
717729
718730#: ../../whatsnew/2.1.rst:480
719731msgid "PEP 217: Interactive Display Hook"
@@ -727,6 +739,9 @@ msgid ""
727739"be called instead of :func:`repr`. For example, you can set it to a special "
728740"pretty-printing function::"
729741msgstr ""
742+ "在交互模式下使用 Python 解释器时,命令的输出是通过内置的 :func:`repr` 函数显示的。在 Python 2.1 中,可以将变量 "
743+ ":func:`sys.displayhook` 设置为一个可调用对象,该对象将在代替 :func:`repr` "
744+ "函数被调用。例如,你可以将其设置为一个特殊的美观打印函数:"
730745
731746#: ../../whatsnew/2.1.rst:503
732747msgid ":pep:`217` - Display Hook for Interactive Use"
@@ -765,6 +780,12 @@ msgid ""
765780"not exist (perhaps raising a :exc:`TypeError`, perhaps trying another "
766781"object's numeric methods)."
767782msgstr ""
783+ "扩展类型现在可以在其 ``PyTypeObject`` 结构中设置类型标志 "
784+ "``Py_TPFLAGS_CHECKTYPES``,以表明它们支持新的强制模型。 "
785+ "在此类扩展类型中,数字槽函数不再假定它们将得到两个相同类型的参数;相反,它们可能会得到两个不同类型的参数,然后可以执行自己的内部强制。如果槽函数传递给它一个无法处理的类型,它可以通过返回一个指向"
786+ " ``Py_NotImplemented`` 单一值的引用来表示失败。 然后将尝试其他类型的数值函数,也许它们可以处理该操作;如果其他类型也返回 "
787+ "``Py_NotImplemented``,那么将引发 :exc:`TypeError`。 用 Python 写的数值方法也可以返回 "
788+ "``Py_NotImplemented``,导致解释器当作该方法不存在(也许会引发 :exc:`TypeError`,也许会尝试另一个对象的数值方法)。"
768789
769790#: ../../whatsnew/2.1.rst:533
770791msgid ":pep:`208` - Reworking the Coercion Model"
@@ -793,6 +814,11 @@ msgid ""
793814" was the largest catalog of Python modules, but registering software at the "
794815"Vaults is optional, and many people did not bother."
795816msgstr ""
817+ "Python 用户经常抱怨的一个问题是,没有一个包含所有 Python 模块的单一目录。 T. Middleton "
818+ "位于``www.vex.net/parnassus/`` 的 Vaults of Parnassus(2009 年 2 月退役,可在 Internet "
819+ "Archive Wayback "
820+ "Machine<https://web.archive.org/web/20090130140102/http://www.vex.net/parnassus/>`_"
821+ " 上查阅\" )是最大的 Python 模块目录,但在 Vaults 注册软件是可选的,很多人都懒得去注册。"
796822
797823#: ../../whatsnew/2.1.rst:552
798824msgid ""
@@ -809,6 +835,12 @@ msgid ""
809835"and :command:`bdist_\\ *` commands could support an ``upload`` option that "
810836"would automatically upload your package to a catalog server."
811837msgstr ""
838+ "作为解决这个问题的第一步,使用 Distutils :command:`sdist` 命令打包的 Python 软件将包含一个名为 "
839+ ":file:`PKG-INFO` 的文件,其中包含有关包的信息,如名称、版本和作者(在目录编制术语中称为元数据)。:file:`PKG-INFO` "
840+ "文件可以包含的字段的完整列表见 :pep:`241`。随着人们开始使用 Python 2.1 "
841+ "打包他们的软件,越来越多的包将包含元数据,从而使得构建自动化目录系统并进行实验成为可能。通过积累经验,也许有可能设计一个真正好的目录系统,然后在 "
842+ "Python 2.2 中支持它。例如,Distutils 的 :command:`sdist` 和 :command:`bdist_\\ *` "
843+ "命令可以支持一个 ``upload`` 选项,自动将你的包上传到目录服务器。"
812844
813845#: ../../whatsnew/2.1.rst:565
814846msgid ""
@@ -851,12 +883,16 @@ msgid ""
851883":mod:`!pydoc.py` to display documentation given a Python module, package, or"
852884" class name. For example, ``pydoc xml.dom`` displays the following::"
853885msgstr ""
886+ "Ka-Ping Yee 贡献了两个新模块::mod:`!inspect.py`,用于获取有关正在运行的 Python 代码的信息,以及 "
887+ ":mod:`!pydoc.py`,用于交互式地将文档字符串转换为 HTML "
888+ "或文本。此外,作为一个额外的功能,:file:`Tools/scripts/pydoc` 现在会自动安装,并使用 :mod:`!pydoc.py` "
889+ "来显示给定 Python 模块、包或类名的文档。例如,``pydoc xml.dom`` 会显示如下内容:"
854890
855891#: ../../whatsnew/2.1.rst:609
856892msgid ""
857893":file:`pydoc` also includes a Tk-based interactive help browser. "
858894":file:`pydoc` quickly becomes addictive; try it out!"
859- msgstr ""
895+ msgstr ":file:`pydoc` 还包括一个基于 Tk 的交互式帮助浏览器。:file:`pydoc` 很快会让人上瘾;试试看! "
860896
861897#: ../../whatsnew/2.1.rst:612
862898msgid ""
@@ -868,6 +904,10 @@ msgid ""
868904"adaptation of Kent Beck's Smalltalk testing framework. See "
869905"https://pyunit.sourceforge.net/ for more information about PyUnit."
870906msgstr ""
907+ "两个不同的单元测试模块被添加到标准库中。:mod:`doctest` 模块,由 Tim Peters "
908+ "贡献,提供了一个基于运行嵌入在文档字符串中的示例并将结果与预期输出进行比较的测试框架。PyUnit,由 Steve Purcell 贡献,是一个受到 "
909+ "JUnit 启发的单元测试框架,而 JUnit 则是对 Kent Beck 的 Smalltalk 测试框架的改编。更多关于 PyUnit "
910+ "的信息,请参阅 https://pyunit.sourceforge.net/ 。"
871911
872912#: ../../whatsnew/2.1.rst:620
873913msgid ""
@@ -878,6 +918,10 @@ msgid ""
878918":program:`diff` program, and in fact the sample program "
879919":file:`Tools/scripts/ndiff.py` demonstrates how to write such a script."
880920msgstr ""
921+ ":mod:`difflib` 模块包含一个类,即 "
922+ ":class:`~difflib.SequenceMatcher`,用于比较两个序列,并计算将一个序列转换为另一个序列所需的变化。 "
923+ "例如,该模块可用于编写与 Unix :program:`diff` 程序类似的工具,事实上,示例程序 "
924+ ":file:`Tools/scripts/ndiff.py` 演示了如何编写这样的脚本。"
881925
882926#: ../../whatsnew/2.1.rst:626
883927msgid ""
@@ -887,6 +931,8 @@ msgid ""
887931"higher or lower in the depth ordering, and the panel library figures out "
888932"where panels overlap and which sections are visible."
889933msgstr ""
934+ ":mod:`curses.panel`,是 ncurses 和 SYSV curses 一部分的 panel 库的包装器,由 Thomas "
935+ "Gellekum 贡献。panel 库为窗口提供了深度特性。窗口可以在深度顺序中向上或向下移动,panel 库会计算出面板的重叠位置和哪些部分是可见的。"
890936
891937#: ../../whatsnew/2.1.rst:632
892938msgid ""
@@ -896,6 +942,9 @@ msgid ""
896942" ability for Expat parsers to handle files in any encoding supported by "
897943"Python, and various bugfixes for SAX, DOM, and the :mod:`!minidom` module."
898944msgstr ""
945+ "PyXML 包自 Python 2.0 以来经历了几次发布,Python 2.1 包含了更新版本的 :mod:`xml` 包。一些值得注意的更改包括支持"
946+ " Expat 1.2 及更高版本,Expat 解析器能够处理 Python 支持的任何编码的文件,以及对 SAX、DOM 和 "
947+ ":mod:`!minidom` 模块的各种错误修复。"
899948
900949#: ../../whatsnew/2.1.rst:638
901950msgid ""
@@ -908,6 +957,10 @@ msgid ""
908957"lists the stack frames, but also lists the function arguments and the local "
909958"variables for each frame."
910959msgstr ""
960+ "Ka-Ping Yee 还贡献了另一个用于处理未捕获异常的钩子。:func:`sys.excepthook` 可以设置为一个可调用对象。当异常未被任何 "
961+ ":keyword:`try`...\\ :keyword:`except` 块捕获时,异常将传递给 "
962+ ":func:`sys.excepthook`,它可以执行任何需要的操作。在第九届 Python "
963+ "会议上,他演示了这个钩子的一个应用:打印扩展的回溯信息,不仅列出堆栈帧,还列出每个帧的函数参数和局部变量。"
911964
912965#: ../../whatsnew/2.1.rst:646
913966msgid ""
0 commit comments