4
4
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
#
6
6
# Translators:
7
- # Freesand Leo <yuqinju@163.com>, 2024
8
- # Unknownuserfrommars, 2024
9
7
# Rafael Fontenelle <rffontenelle@gmail.com>, 2024
8
+ # Unknownuserfrommars, 2024
9
+ # Freesand Leo <yuqinju@163.com>, 2024
10
10
#
11
11
#, fuzzy
12
12
msgid ""
@@ -15,7 +15,7 @@ msgstr ""
15
15
"Report-Msgid-Bugs-To : \n "
16
16
"POT-Creation-Date : 2024-05-31 14:49+0000\n "
17
17
"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 "
19
19
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
20
20
"MIME-Version : 1.0\n "
21
21
"Content-Type : text/plain; charset=UTF-8\n "
@@ -637,6 +637,9 @@ msgid ""
637
637
"to use a proxy will cause a :exc:`!weakref.ReferenceError` exception to be "
638
638
"raised. ::"
639
639
msgstr ""
640
+ ":mod:`weakref` 模块还允许创建代理对象,代理对象的行为类似于弱引用--"
641
+ "仅被代理对象引用的对象会被解分配,但只要对象仍然存在,代理就会透明地将所有操作转发给对象,而不需要显式调用来检索对象。 "
642
+ "如果对象已被解分配,尝试使用代理将引发:exc:`!weakref.ReferenceError` 异常:"
640
643
641
644
#: ../../whatsnew/2.1.rst:416
642
645
msgid ":pep:`205` - Weak References"
@@ -683,6 +686,9 @@ msgid ""
683
686
"Python dictionary; you *can't* be tricky and set it to a :class:`!UserDict` "
684
687
"instance, or any other random object that behaves like a mapping."
685
688
msgstr ""
689
+ "包含属性的字典可以作为函数的 :attr:`~object.__dict__` 访问。 与类实例的 :attr:`~object.__dict__` "
690
+ "属性不同,在函数中,您实际上可以为 :attr:`~object.__dict__` 分配一个新的字典,尽管新值仅限于普通的 Python 字典;您 "
691
+ "*不能* 狡猾地将其设置为 :class:`!UserDict` 实例,或任何其他行为类似映射的随机对象。"
686
692
687
693
#: ../../whatsnew/2.1.rst:455
688
694
msgid ":pep:`232` - Function Attributes"
@@ -703,6 +709,8 @@ msgid ""
703
709
"distinguish the filenames ``FILE.PY`` and ``file.py``, even though they do "
704
710
"store the file's name in its original case (they're case-preserving, too)."
705
711
msgstr ""
712
+ "一些操作系统的文件系统是区分大小写的,MacOS 和 Windows 是主要的例子;在这些系统上,无法区分文件名 ``FILE.PY`` 和 "
713
+ "``file.py``,尽管它们确实以原始大小写存储文件名(它们也是区分大小写的)"
706
714
707
715
#: ../../whatsnew/2.1.rst:469
708
716
msgid ""
@@ -714,6 +722,10 @@ msgid ""
714
722
":envvar:`PYTHONCASEOK` environment variable before starting the Python "
715
723
"interpreter."
716
724
msgstr ""
725
+ "在 Python 2.1 中,:keyword:`import` 语句可以在不区分大小写的平台上模拟大小写敏感性。 现在,Python "
726
+ "默认搜索第一个大小写敏感匹配的文件,如果找不到这样的文件,就会引发 :exc:`ImportError`,因此 ``import file`` "
727
+ "不会导入名为 ``FILE.PY`` 的模块。 在启动 Python 解释器之前,可以通过设置 :envvar:`PYTHONCASEOK` "
728
+ "环境变量来请求大小写不敏感匹配。"
717
729
718
730
#: ../../whatsnew/2.1.rst:480
719
731
msgid "PEP 217: Interactive Display Hook"
@@ -727,6 +739,9 @@ msgid ""
727
739
"be called instead of :func:`repr`. For example, you can set it to a special "
728
740
"pretty-printing function::"
729
741
msgstr ""
742
+ "在交互模式下使用 Python 解释器时,命令的输出是通过内置的 :func:`repr` 函数显示的。在 Python 2.1 中,可以将变量 "
743
+ ":func:`sys.displayhook` 设置为一个可调用对象,该对象将在代替 :func:`repr` "
744
+ "函数被调用。例如,你可以将其设置为一个特殊的美观打印函数:"
730
745
731
746
#: ../../whatsnew/2.1.rst:503
732
747
msgid ":pep:`217` - Display Hook for Interactive Use"
@@ -765,6 +780,12 @@ msgid ""
765
780
"not exist (perhaps raising a :exc:`TypeError`, perhaps trying another "
766
781
"object's numeric methods)."
767
782
msgstr ""
783
+ "扩展类型现在可以在其 ``PyTypeObject`` 结构中设置类型标志 "
784
+ "``Py_TPFLAGS_CHECKTYPES``,以表明它们支持新的强制模型。 "
785
+ "在此类扩展类型中,数字槽函数不再假定它们将得到两个相同类型的参数;相反,它们可能会得到两个不同类型的参数,然后可以执行自己的内部强制。如果槽函数传递给它一个无法处理的类型,它可以通过返回一个指向"
786
+ " ``Py_NotImplemented`` 单一值的引用来表示失败。 然后将尝试其他类型的数值函数,也许它们可以处理该操作;如果其他类型也返回 "
787
+ "``Py_NotImplemented``,那么将引发 :exc:`TypeError`。 用 Python 写的数值方法也可以返回 "
788
+ "``Py_NotImplemented``,导致解释器当作该方法不存在(也许会引发 :exc:`TypeError`,也许会尝试另一个对象的数值方法)。"
768
789
769
790
#: ../../whatsnew/2.1.rst:533
770
791
msgid ":pep:`208` - Reworking the Coercion Model"
@@ -793,6 +814,11 @@ msgid ""
793
814
" was the largest catalog of Python modules, but registering software at the "
794
815
"Vaults is optional, and many people did not bother."
795
816
msgstr ""
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 注册软件是可选的,很多人都懒得去注册。"
796
822
797
823
#: ../../whatsnew/2.1.rst:552
798
824
msgid ""
@@ -809,6 +835,12 @@ msgid ""
809
835
"and :command:`bdist_\\ *` commands could support an ``upload`` option that "
810
836
"would automatically upload your package to a catalog server."
811
837
msgstr ""
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`` 选项,自动将你的包上传到目录服务器。"
812
844
813
845
#: ../../whatsnew/2.1.rst:565
814
846
msgid ""
@@ -851,12 +883,16 @@ msgid ""
851
883
":mod:`!pydoc.py` to display documentation given a Python module, package, or"
852
884
" class name. For example, ``pydoc xml.dom`` displays the following::"
853
885
msgstr ""
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`` 会显示如下内容:"
854
890
855
891
#: ../../whatsnew/2.1.rst:609
856
892
msgid ""
857
893
":file:`pydoc` also includes a Tk-based interactive help browser. "
858
894
":file:`pydoc` quickly becomes addictive; try it out!"
859
- msgstr ""
895
+ msgstr ":file:`pydoc` 还包括一个基于 Tk 的交互式帮助浏览器。:file:`pydoc` 很快会让人上瘾;试试看! "
860
896
861
897
#: ../../whatsnew/2.1.rst:612
862
898
msgid ""
@@ -868,6 +904,10 @@ msgid ""
868
904
"adaptation of Kent Beck's Smalltalk testing framework. See "
869
905
"https://pyunit.sourceforge.net/ for more information about PyUnit."
870
906
msgstr ""
907
+ "两个不同的单元测试模块被添加到标准库中。:mod:`doctest` 模块,由 Tim Peters "
908
+ "贡献,提供了一个基于运行嵌入在文档字符串中的示例并将结果与预期输出进行比较的测试框架。PyUnit,由 Steve Purcell 贡献,是一个受到 "
909
+ "JUnit 启发的单元测试框架,而 JUnit 则是对 Kent Beck 的 Smalltalk 测试框架的改编。更多关于 PyUnit "
910
+ "的信息,请参阅 https://pyunit.sourceforge.net/ 。"
871
911
872
912
#: ../../whatsnew/2.1.rst:620
873
913
msgid ""
@@ -878,6 +918,10 @@ msgid ""
878
918
":program:`diff` program, and in fact the sample program "
879
919
":file:`Tools/scripts/ndiff.py` demonstrates how to write such a script."
880
920
msgstr ""
921
+ ":mod:`difflib` 模块包含一个类,即 "
922
+ ":class:`~difflib.SequenceMatcher`,用于比较两个序列,并计算将一个序列转换为另一个序列所需的变化。 "
923
+ "例如,该模块可用于编写与 Unix :program:`diff` 程序类似的工具,事实上,示例程序 "
924
+ ":file:`Tools/scripts/ndiff.py` 演示了如何编写这样的脚本。"
881
925
882
926
#: ../../whatsnew/2.1.rst:626
883
927
msgid ""
@@ -887,6 +931,8 @@ msgid ""
887
931
"higher or lower in the depth ordering, and the panel library figures out "
888
932
"where panels overlap and which sections are visible."
889
933
msgstr ""
934
+ ":mod:`curses.panel`,是 ncurses 和 SYSV curses 一部分的 panel 库的包装器,由 Thomas "
935
+ "Gellekum 贡献。panel 库为窗口提供了深度特性。窗口可以在深度顺序中向上或向下移动,panel 库会计算出面板的重叠位置和哪些部分是可见的。"
890
936
891
937
#: ../../whatsnew/2.1.rst:632
892
938
msgid ""
@@ -896,6 +942,9 @@ msgid ""
896
942
" ability for Expat parsers to handle files in any encoding supported by "
897
943
"Python, and various bugfixes for SAX, DOM, and the :mod:`!minidom` module."
898
944
msgstr ""
945
+ "PyXML 包自 Python 2.0 以来经历了几次发布,Python 2.1 包含了更新版本的 :mod:`xml` 包。一些值得注意的更改包括支持"
946
+ " Expat 1.2 及更高版本,Expat 解析器能够处理 Python 支持的任何编码的文件,以及对 SAX、DOM 和 "
947
+ ":mod:`!minidom` 模块的各种错误修复。"
899
948
900
949
#: ../../whatsnew/2.1.rst:638
901
950
msgid ""
@@ -908,6 +957,10 @@ msgid ""
908
957
"lists the stack frames, but also lists the function arguments and the local "
909
958
"variables for each frame."
910
959
msgstr ""
960
+ "Ka-Ping Yee 还贡献了另一个用于处理未捕获异常的钩子。:func:`sys.excepthook` 可以设置为一个可调用对象。当异常未被任何 "
961
+ ":keyword:`try`...\\ :keyword:`except` 块捕获时,异常将传递给 "
962
+ ":func:`sys.excepthook`,它可以执行任何需要的操作。在第九届 Python "
963
+ "会议上,他演示了这个钩子的一个应用:打印扩展的回溯信息,不仅列出堆栈帧,还列出每个帧的函数参数和局部变量。"
911
964
912
965
#: ../../whatsnew/2.1.rst:646
913
966
msgid ""
0 commit comments