Skip to content

Commit e04ac93

Browse files
[po] auto sync
1 parent 9895834 commit e04ac93

File tree

2 files changed

+97
-8
lines changed

2 files changed

+97
-8
lines changed

.stat.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "93.01%", "updated_at": "2024-05-28T07:20:15Z"}
1+
{"translation": "93.09%", "updated_at": "2024-05-29T02:25:36Z"}

whatsnew/2.0.po

+96-7
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@ msgid ""
564564
"Perl, and PHP also support them. The augmented assignment patch was "
565565
"implemented by Thomas Wouters."
566566
msgstr ""
567+
"增强赋值运算符最早在 C 编程语言中引入,大多数 C 派生语言,如 :program:`awk`,C++,Java 和 PHP 也支持它们。 "
568+
"增强赋值补丁由 Thomas Wouters 实现。"
567569

568570
#: ../../whatsnew/2.0.rst:390
569571
msgid "String Methods"
@@ -585,7 +587,7 @@ msgid ""
585587
"Instead, Python 2.0 pushes the problem onto the string type, making string "
586588
"manipulation functionality available through methods on both 8-bit strings "
587589
"and Unicode strings. ::"
588-
msgstr ""
590+
msgstr "相反,Python 2.0 将这个问题推给了字符串类型,使字符串操作功能通过 8 位字符串和 Unicode 字符串上的方法来实现。"
589591

590592
#: ../../whatsnew/2.0.rst:411
591593
msgid ""
@@ -594,12 +596,13 @@ msgid ""
594596
"methods return new strings, and do not modify the string on which they "
595597
"operate."
596598
msgstr ""
599+
"有一件事没有改变,即使是值得注意的愚人节玩笑,Python 字符串仍然是不可变的。 因此,字符串方法返回的是新的字符串,而不是修改他们操作的原字符串。"
597600

598601
#: ../../whatsnew/2.0.rst:415
599602
msgid ""
600603
"The old :mod:`string` module is still around for backwards compatibility, "
601604
"but it mostly acts as a front-end to the new string methods."
602-
msgstr ""
605+
msgstr "旧的 :mod:`string` 模块仍然存在以保持向向兼容,但它主要作为新字符串方法的前端。"
603606

604607
#: ../../whatsnew/2.0.rst:418
605608
msgid ""
@@ -631,6 +634,8 @@ msgid ""
631634
"no longer accessible, since you need to have a reference to an object to "
632635
"access it, and if the count is zero, no references exist any longer."
633636
msgstr ""
637+
"Python 的 C 实现使用引用技术来实现垃圾回收。 每个 Python 对象维护一个指向自身的引用数量,并在引用创建或销毁时调整该计数。 "
638+
"一旦引用计数达到零,对象就不再可访问,因为访问对象需要一个引用,然后如果计数为零,就不再存在任何引用。"
634639

635640
#: ../../whatsnew/2.0.rst:442
636641
msgid ""
@@ -641,19 +646,22 @@ msgid ""
641646
"doesn't realise that objects are no longer accessible, resulting in a memory"
642647
" leak. This happens when there are cycles of references."
643648
msgstr ""
649+
"引用计数有一些令人愉快的特性:它易于理解和实现,结果实现是可移植的,相当快,并且与其他实现自己内存处理方案的库良好互动。引用计数的主要问题是有时它无法识别对象不再可访问,从而导致内存泄露,这发生在存在引用循环时。"
644650

645651
#: ../../whatsnew/2.0.rst:449
646652
msgid ""
647653
"Consider the simplest possible cycle, a class instance which has a "
648654
"reference to itself::"
649-
msgstr ""
655+
msgstr "考虑最简单的循环,一个类实例引用自身::"
650656

651657
#: ../../whatsnew/2.0.rst:455
652658
msgid ""
653659
"After the above two lines of code have been executed, the reference count of"
654660
" ``instance`` is 2; one reference is from the variable named ``'instance'``,"
655661
" and the other is from the ``myself`` attribute of the instance."
656662
msgstr ""
663+
"在执行完上述两行代码后,``instance`` 的引用计数是 2;一个引用来自名为 ``'instance'`` 的变量,另一个引用来自该实例的 "
664+
"``myself`` 属性。"
657665

658666
#: ../../whatsnew/2.0.rst:459
659667
msgid ""
@@ -664,6 +672,9 @@ msgid ""
664672
" objects can participate in a cycle if they have references to each other, "
665673
"causing all of the objects to be leaked."
666674
msgstr ""
675+
"如果下一行代码是 ``del instance``,会发生什么? ``instance`` 的引用计数会减少 1,所以它的引用计数变为 "
676+
"1;``myself`` 属性中的引用仍然存在。 然而,该实例不能再通过 Python 代码访问,并且它可以被删除。 "
677+
"如果多个对象相互引用,它们可以参与一个循环,导致所有对象都无法被垃圾回收,从而导致内存泄漏。"
667678

668679
#: ../../whatsnew/2.0.rst:466
669680
msgid ""
@@ -673,6 +684,8 @@ msgid ""
673684
"collection, obtain debugging statistics, and tuning the collector's "
674685
"parameters."
675686
msgstr ""
687+
"Python 2.0 通过周期性的执行一个循环检测算法来解决这个问题,该算法查找不可访问的循环并删除涉及的对象。 一个新的 :mod:`gc` "
688+
"模块提供了执行垃圾回收、获取调试统计信息和调整回收器参数的功能。"
676689

677690
#: ../../whatsnew/2.0.rst:471
678691
msgid ""
@@ -687,6 +700,10 @@ msgid ""
687700
"buggy, by specifying the :option:`!--without-cycle-gc` switch when running "
688701
"the :program:`configure` script."
689702
msgstr ""
703+
"运行循环检测算法需要一些时间,因此会带来一些额外的开销,希望在使用 2.0 版本的循环收集经验之后,Python 2.1 "
704+
"可以通过精细调整来尽量减少开销。 目前还不清楚性能损失有多大,因为对此进行精准测试很棘手,而且关键在于程序创建和销毁对象的频率。 "
705+
"如果你不能接受哪怕是微小的速度损失,或者怀疑循环收集存在问题,可以在编译 Python 时禁用循环检测,通过在运行 "
706+
":program:`configure` 脚本时指定 :option:`!--without-cycle-gc` 开关来实现。"
690707

691708
#: ../../whatsnew/2.0.rst:482
692709
msgid ""
@@ -700,6 +717,10 @@ msgid ""
700717
"threads titled \"Reference cycle collection for Python\" and \"Finalization "
701718
"again\"."
702719
msgstr ""
720+
"有几个人解决了这个问题并为解决方案做出了贡献。循环检测方法的早期实现由 Toby Kelsey 编写。 当前的算法是在 Eric Tiedemann "
721+
"访问 CNRI 期间提出的,Guido van Rossum 和 Neil Schemenauer 分别编写了两个不同的实现,后来由 Neil "
722+
"将它们整合。 许多其他人也在过程中提出了建议;python-dev 邮件列表 2000 年 3 月的存档包含了大部分相关讨论,尤其是在标题为 "
723+
"“Reference cycle collection for Python” 和 “Finalization again” 的帖子中。"
703724

704725
#: ../../whatsnew/2.0.rst:495
705726
msgid "Other Core Changes"
@@ -710,7 +731,7 @@ msgid ""
710731
"Various minor changes have been made to Python's syntax and built-in "
711732
"functions. None of the changes are very far-reaching, but they're handy "
712733
"conveniences."
713-
msgstr ""
734+
msgstr "Python 的语法和内置函数进行了各种小改动。 虽然这些改动都不是非常深远,但它们都是很方便的改进。"
714735

715736
#: ../../whatsnew/2.0.rst:502
716737
msgid "Minor Language Changes"
@@ -745,6 +766,8 @@ msgid ""
745766
"module as name`` or ``from module import name as othername``. The patch was"
746767
" submitted by Thomas Wouters."
747768
msgstr ""
769+
"模块现在可以在导入时重命名,使用语法 ``import module as name`` 或 ``from module import name as "
770+
"othername``。这个补丁是由 Thomas Wouters 提交的。"
748771

749772
#: ../../whatsnew/2.0.rst:532
750773
msgid ""
@@ -754,6 +777,9 @@ msgid ""
754777
"which inserts the :func:`str` of its argument. For example, ``'%r %s' % "
755778
"('abc', 'abc')`` returns a string containing ``'abc' abc``."
756779
msgstr ""
780+
"当使用 ``%`` 操作符时有一种新的格式样式可用;'%r' 将插入其参数的 :func:`repr` 表示。 这也是为了对称性,这次是为了与现有的 "
781+
"%s 格式样式对称,后者插入其参数的 :func:`str` 表示。例如,``'%r %s' % ('abc', 'abc')`` 返回一个包含 "
782+
"``'abc' abc`` 的字符串。"
757783

758784
#: ../../whatsnew/2.0.rst:538
759785
msgid ""
@@ -777,6 +803,9 @@ msgid ""
777803
" and crashed; Jeremy Hylton rewrote the code to no longer crash, producing a"
778804
" useful result instead. For example, after this code::"
779805
msgstr ""
806+
"早期版本的 Python 使用递归算法来删除对象。深度嵌套的数据结构可能导致解释器填满 C 栈并崩溃。 Christian Tismer "
807+
"重写了删除逻辑来解决这个问题。 相关地,比较递归对象时会导致无线递归并崩溃。Jeremy Hylton 重写了代码,使其不再崩溃,而是产生有用的结果。 "
808+
"例如,在以下代码之后::"
780809

781810
#: ../../whatsnew/2.0.rst:559
782811
msgid ""
@@ -807,6 +836,8 @@ msgid ""
807836
"suffix=.x\". Consult the README in the Python source distribution for more "
808837
"instructions."
809838
msgstr ""
839+
"另一个新的平台是 Darwin/MacOS X;Python 2.0 中提供了初步支持。如果你指定 \"configure --with-dyld "
840+
"--with-suffix=.x\",动态加载是可行的。 有关更多说明,请参阅 Python 源代码分发中的 README 文件。"
810841

811842
#: ../../whatsnew/2.0.rst:581
812843
msgid ""
@@ -819,6 +850,11 @@ msgid ""
819850
"of :exc:`NameError`, so any existing code that expects :exc:`NameError` to "
820851
"be raised should still work. ::"
821852
msgstr ""
853+
"已经尝试解决 Python 的一个问题,即当代码在局部变量赋值之前引用该变量时,会引发经常令人困惑的 :exc:`NameError` "
854+
"异常。例如,以下代码在 1.5.2 和 2.0 中都会在 ``print`` 语句上引发异常;在 1.5.2 中,会引发 "
855+
":exc:`NameError` 异常,而在 2.0 中,会引发一个新的 :exc:`UnboundLocalError` 异常。 "
856+
":exc:`UnboundLocalError` 是 :exc:`NameError` 的子类,因此任何期望引发 :exc:`NameError` "
857+
"的现有代码应该仍然可以正常工作。"
822858

823859
#: ../../whatsnew/2.0.rst:595
824860
msgid ""
@@ -842,6 +878,10 @@ msgid ""
842878
"``None`` if the sequences aren't all of the same length, while :func:`zip` "
843879
"truncates the returned list to the length of the shortest argument sequence."
844880
msgstr ""
881+
"添加了一个新的内置函数 ``zip(seq1, seq2, ...)``。:func:`zip` "
882+
"返回一个包含元组的列表,每个元组包含每个参数序列的第i个元素。:func:`zip` 和 ``map(None, seq1, seq2)`` "
883+
"的区别在于,如果序列长度不一致,:func:`map` 会用 ``None`` 填充序列,而 :func:`zip` "
884+
"会将返回的列表截短到最短的参数序列的长度。"
845885

846886
#: ../../whatsnew/2.0.rst:610
847887
msgid ""
@@ -860,6 +900,10 @@ msgid ""
860900
"``sys.version_info`` would be ``(2, 0, 1, 'beta', 1)``. *level* is a string "
861901
"such as ``\"alpha\"``, ``\"beta\"``, or ``\"final\"`` for a final release."
862902
msgstr ""
903+
"在 :mod:`sys` 模块中添加了一个新变量,用于保存更详细的版本信息。 ``sys.version_info`` 是一个包含五个元素的元组 "
904+
"``(major, minor, micro, level, serial)``。 例如,在假设的 2.0.1beta1 "
905+
"版本中,``sys.version_info`` 将是 ``(2, 0, 1, 'beta', 1)``。 *level* 是一个字符串,如 "
906+
"``\"alpha\"``、``\"beta\"`` 或代表最终发布版本的 ``\"final\"``。"
863907

864908
#: ../../whatsnew/2.0.rst:622
865909
msgid ""
@@ -873,7 +917,7 @@ msgstr ""
873917
#: ../../whatsnew/2.0.rst:633
874918
msgid ""
875919
"can be reduced to a single ``return dict.setdefault(key, [])`` statement."
876-
msgstr ""
920+
msgstr "可以简化为单个``return dict.setdefault(key, [])``语句。"
877921

878922
#: ../../whatsnew/2.0.rst:635
879923
msgid ""
@@ -885,6 +929,10 @@ msgid ""
885929
" value is 1000, and a rough maximum value for a given platform can be found "
886930
"by running a new script, :file:`Misc/find_recursionlimit.py`."
887931
msgstr ""
932+
"解释器设置了一个最大递归深度,以便在填满 C 栈并导致核心储存或 GPF 之前捕获失控递归。以前这个限制是在编译 Python 时固定的,但在 2.0 "
933+
"中最大递归深度可以使用 :func:`sys.getrecursionlimit` 和 :func:`sys.setrecursionlimit` "
934+
"读取和修改。 默认值是 1000,可以通过运行一个新脚本 :file:`Misc/find_recursionlimit.py` "
935+
"来找到给定平台的大致的最大值。"
888936

889937
#: ../../whatsnew/2.0.rst:647
890938
msgid "Porting to 2.0"
@@ -899,6 +947,9 @@ msgid ""
899947
"always be avoided. This section lists the changes in Python 2.0 that may "
900948
"cause old Python code to break."
901949
msgstr ""
950+
"新的 Python 版本尽力与之前的版本兼容,而且兼容性记录相当不错。 "
951+
"然而,有些变化被认为足够有用,通常是因为他们修正了最终设计中的错误决定,因此有时无法避免打破向后兼容性。 本节列出了 Python 2.0 中可能导致旧"
952+
" Python 代码中断的更改。"
902953

903954
#: ../../whatsnew/2.0.rst:656
904955
msgid ""
@@ -947,6 +998,8 @@ msgid ""
947998
"the lowest 8 bits of the result, so ``\\x123456`` was equivalent to "
948999
"``\\x56``."
9491000
msgstr ""
1001+
"字符串字面量中的 ``\\x`` 转义现在必须精确地使用2个十六进制数字。之前它会消耗 x 后面的所有十六进制数字,并取结果的最低8位,所以 "
1002+
"``\\x123456`` 等同于 ``\\x56``。"
9501003

9511004
#: ../../whatsnew/2.0.rst:688
9521005
msgid ""
@@ -956,6 +1009,9 @@ msgid ""
9561009
" error message was just the missing attribute name ``eggs``, and code "
9571010
"written to take advantage of this fact will break in 2.0."
9581011
msgstr ""
1012+
":exc:`AttributeError` 和 :exc:`NameError` 异常现在有了更友好的错误消息,其文本内容类似于 ``'Spam' "
1013+
"instance has no attribute 'eggs'`` 或 ``name 'eggs' is not defined``。 "
1014+
"之前的错误消息只是缺少的属性名称,如 ``eggs``,因此利用这一事实编写的代码在 2.0 中会中断。"
9591015

9601016
#: ../../whatsnew/2.0.rst:694
9611017
msgid ""
@@ -984,6 +1040,9 @@ msgid ""
9841040
" which does ``str(longval)[:-1]`` and assumes the 'L' is there, will now "
9851041
"lose the final digit."
9861042
msgstr ""
1043+
"最微妙的长整数变化是,长整数的 :func:`str` 表示不再有尾随的 'L' 字符,尽管 :func:`repr` "
1044+
"表示仍然包含它。许多人在打印长整数时不希望看到 'L' 字符,因为他们不得不专门去掉这个字符。在2.0中,这不再是一个问题,但那些使用 "
1045+
"``str(longval)[:-1]`` 并假设存在 'L' 的代码,现在将丢失最后一个数字。"
9871046

9881047
#: ../../whatsnew/2.0.rst:716
9891048
msgid ""
@@ -1016,6 +1075,8 @@ msgid ""
10161075
"larger application. If you aren't dealing with Python's C API, you can "
10171076
"safely skip this section."
10181077
msgstr ""
1078+
"有些更改是在底层进行的,仅对编写 C 扩展模块或在更大的应用中嵌入 Python 解释器的人有价值。 如果你不处理 Python 的 C "
1079+
"API,可以安全地跳过这一节。"
10191080

10201081
#: ../../whatsnew/2.0.rst:747
10211082
msgid ""
@@ -1025,6 +1086,9 @@ msgid ""
10251086
"built for Python 1.5.x due to how Windows DLLs work, so Python will raise an"
10261087
" exception and the import will fail."
10271088
msgstr ""
1089+
" Python C API 的版本号已增加,因此为 1.5.2 编译的 C 扩展必须重新编译才能与 2.0 一起工作。 在 Windows 上,由于 "
1090+
"Windows DLL 的工作方式,Python 2.0 无法导入为 Python 1.5.x 构建的第三方扩展,因此 Python "
1091+
"会引发异常并造成导入失败。"
10281092

10291093
#: ../../whatsnew/2.0.rst:753
10301094
msgid ""
@@ -1034,6 +1098,10 @@ msgid ""
10341098
"remember to write code such as ``if type(obj) == myExtensionClass``, but can"
10351099
" use the more natural ``if isinstance(obj, myExtensionClass)``."
10361100
msgstr ""
1101+
"使用 Jim Fulton 的 ExtensionClass 模块的用户将很高兴地发现,已经添加了钩子以支持 "
1102+
"ExtensionClasses,因此现在支持 :func:`isinstance` 和 :func:`issubclass`。 "
1103+
"这意味着你不再需要记住编写类似 ``if type(obj) == myExtensionClass`` 这样的代码,而可以使用更自然的 ``if "
1104+
"isinstance(obj, myExtensionClass)``。"
10371105

10381106
#: ../../whatsnew/2.0.rst:759
10391107
msgid ""
@@ -1045,6 +1113,10 @@ msgid ""
10451113
"Include/ directory that held various portability hacks; they've been merged "
10461114
"into a single file, :file:`Include/pyport.h`."
10471115
msgstr ""
1116+
":file:`Python/importdl.c` 文件,它充满了用于支持在许多不同平台上动态加载的 #ifdef,已被 Greg Stein "
1117+
"清理和重组。现在 :file:`importdl.c` 非常小,平台特定的代码已被移入一组特定的 "
1118+
":file:`Python/dynload_\\*.c` 文件中。 另一个清理工作是:Include/ 目录中有许多包含各种可移植性修改的 "
1119+
":file:`my\\*.h` 文件;它们已被合并到一个文件中,即 :file:`Include/pyport.h`。"
10481120

10491121
#: ../../whatsnew/2.0.rst:767
10501122
msgid ""
@@ -1063,6 +1135,8 @@ msgid ""
10631135
"Macintosh. Threading support using the user-space GNU ``pth`` library was "
10641136
"also contributed."
10651137
msgstr ""
1138+
"最新版本的 MacOS GUSI 开发环境支持 POSIX 线程。 因此,现在 Python 的 POSIX 线程支持在 Macintosh "
1139+
"上也可以使用。 还贡献了使用用户空间 GNU ``pth`` 库的线程支持。"
10661140

10671141
#: ../../whatsnew/2.0.rst:779
10681142
msgid ""
@@ -1073,13 +1147,18 @@ msgid ""
10731147
"slow as an unthreaded version; with the 2.0 changes, the difference is only "
10741148
"10%. These improvements were contributed by Yakov Markovitch."
10751149
msgstr ""
1150+
"Windows 上的线程支持也得到了增强。 Windows "
1151+
"支持的线程锁在发生争用时才使用内核对象;在常见的没有争用的情况下,他们使用简单得多的函数,这些函数快一个数量级。Python 1.5.2 在 NT "
1152+
"上的线程版本比无线程版本慢两倍;有了 2.0 的改进,差异仅为 10%。 这些改进由 Yakov Markovitch 提供。"
10761153

10771154
#: ../../whatsnew/2.0.rst:786
10781155
msgid ""
10791156
"Python 2.0's source now uses only ANSI C prototypes, so compiling Python now"
10801157
" requires an ANSI C compiler, and can no longer be done using a compiler "
10811158
"that only supports K&R C."
10821159
msgstr ""
1160+
"Python 2.0 的源代码目前只用 ANSI C 原型,所以现在编译 Python 需要一个 ANSI C 的编译器,而不能通过仅使用支持 K&R "
1161+
"C 的编译器完成。"
10831162

10841163
#: ../../whatsnew/2.0.rst:790
10851164
msgid ""
@@ -1089,6 +1168,9 @@ msgid ""
10891168
"people who are generating Python code would run into this limit. A patch by"
10901169
" Charles G. Waldman raises the limit from ``2**16`` to ``2**32``."
10911170
msgstr ""
1171+
"之前,Python 虚拟机在其字节码中使用 16 位数字,限制了源文件的大小。 特别是,这影响了 Python "
1172+
"源代码中字面量列表和字典的最大大小;偶尔会有人在生成 Python 代码时遇到这个限制。 Charles G. Waldman 的补丁将这个限制从 "
1173+
"``2**16`` 提高到 ``2**32``。"
10921174

10931175
#: ../../whatsnew/2.0.rst:796
10941176
msgid ""
@@ -1122,6 +1204,9 @@ msgid ""
11221204
"different extension packages, which made administering a Python installation"
11231205
" something of a chore."
11241206
msgstr ""
1207+
"在 Python 2.0 之前,安装模块是一件繁琐的事情 —— 没有办法自动确定 Python 的安装位置,或者用于扩展模块的编译器选项。 "
1208+
"软件作者不得不经历一套繁琐的程序来编辑 Makefile 和配置文件,这些只在 Unix 上真正有效,而 Windows 和 Mac OS 不受支持。 "
1209+
"Python 用户面对不同扩展包之间大相径庭的安装说明,这使得管理 Python 成了一件麻烦事。"
11251210

11261211
#: ../../whatsnew/2.0.rst:821
11271212
msgid ""
@@ -1171,12 +1256,16 @@ msgid ""
11711256
"distribution formats such as Debian packages and Solaris :file:`.pkg` files "
11721257
"are in various stages of development."
11731258
msgstr ""
1259+
"Distutils 还可以负责创建源代码和二进制分发包。运行 ``python setup.py sdist`` 的 \"sdist\" "
1260+
"命令构建一个源代码分发包,如 :file:`foo-1.0.tar.gz`。添加新命令并不困难,已经有 \"bdist_rpm\" 和 "
1261+
"\"bdist_wininst\" 命令,分别用于创建软件的 RPM 分发包和 Windows 安装程序。创建其他分发格式的命令,如 Debian 包和"
1262+
" Solaris :file:`.pkg` 文件,也在开发的不同阶段。"
11741263

11751264
#: ../../whatsnew/2.0.rst:873
11761265
msgid ""
11771266
"All this is documented in a new manual, *Distributing Python Modules*, that "
11781267
"joins the basic set of Python documentation."
1179-
msgstr ""
1268+
msgstr "所有这些都记录在一个新手册中,*Distributing Python Modules*,它加入了Python文档的基本集合中。"
11801269

11811270
#: ../../whatsnew/2.0.rst:880
11821271
msgid "XML Modules"
@@ -1199,7 +1288,7 @@ msgstr ""
11991288

12001289
#: ../../whatsnew/2.0.rst:896
12011290
msgid "SAX2 Support"
1202-
msgstr ""
1291+
msgstr "SAX2 支持"
12031292

12041293
#: ../../whatsnew/2.0.rst:898
12051294
msgid ""

0 commit comments

Comments
 (0)