1
1
# SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2022 , Python Software Foundation
2
+ # Copyright (C) 2001-2024 , Python Software Foundation
3
3
# This file is distributed under the same license as the Python package.
4
4
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
#
6
6
# Translators:
7
7
# Fei Yin <icebirds@163.com>, 2018
8
8
# 叶浚安 <ye.pandaaaa906@gmail.com>, 2019
9
9
# ppcfish <ppcfish@gmail.com>, 2019
10
- # Freesand Leo <yuqinju@163.com>, 2022
10
+ # Rafael Fontenelle <rffontenelle@gmail.com>, 2023
11
+ # Freesand Leo <yuqinju@163.com>, 2024
11
12
#
12
13
#, fuzzy
13
14
msgid ""
14
15
msgstr ""
15
16
"Project-Id-Version : Python 3.9\n "
16
17
"Report-Msgid-Bugs-To : \n "
17
- "POT-Creation-Date : 2022-11-04 14:34 +0000\n "
18
+ "POT-Creation-Date : 2024-03-01 21:26 +0000\n "
18
19
"PO-Revision-Date : 2017-02-16 23:42+0000\n "
19
- "Last-Translator : Freesand Leo <yuqinju@163.com>, 2022 \n "
20
- "Language-Team : Chinese (China) (https://www .transifex.com/python-doc/teams/5390/zh_CN/)\n "
20
+ "Last-Translator : Freesand Leo <yuqinju@163.com>, 2024 \n "
21
+ "Language-Team : Chinese (China) (https://app .transifex.com/python-doc/teams/5390/zh_CN/)\n "
21
22
"MIME-Version : 1.0\n "
22
23
"Content-Type : text/plain; charset=UTF-8\n "
23
24
"Content-Transfer-Encoding : 8bit\n "
@@ -53,6 +54,10 @@ msgid ""
53
54
"to the specific PEP, for more details about any new feature that "
54
55
"particularly interests you."
55
56
msgstr ""
57
+ "本文介绍了 Python 2.1 的新增特性。 虽然 2.1 的改变没有 Python 2.0 那么多,但是仍然有一些令人惊喜的东西。 2.1 "
58
+ "是第一个使用 Python 增强提议,即 PEP 来进行引导的发行版,因此大部分重要的改变都有相应的 PEP 来提供有关改变的更完整文档和设计思路。 "
59
+ "本文并未试图完整记录所有的新特性,而是为 Python 程序员提供新特性的简单概览。 请参阅 Python 2.1 文档,或特定的 "
60
+ "PEP,获取针对你感兴趣的任何新特性的更多细节。"
56
61
57
62
#: ../../whatsnew/2.1.rst:25
58
63
msgid ""
@@ -61,6 +66,8 @@ msgid ""
61
66
"the first release to come out at this faster pace, with the first alpha "
62
67
"appearing in January, 3 months after the final version of 2.0 was released."
63
68
msgstr ""
69
+ "Python 开发团队的一个近期目标是加速新发行版的步调,使得每 6 到 9 个月就有一个新发行版。 2.1 "
70
+ "是基于这个新步调推出的第一个发行版,第一个内测版将于一月发布,即 2.0 最终版发布 3 个月之后。"
64
71
65
72
#: ../../whatsnew/2.1.rst:30
66
73
msgid "The final release of Python 2.1 was made on April 17, 2001."
@@ -78,6 +85,9 @@ msgid ""
78
85
" surprised people because it didn't match their intuitive expectations. For"
79
86
" example, a nested recursive function definition doesn't work::"
80
87
msgstr ""
88
+ "Python 2.1 中的最大改变是 Python 的作用域规则。 在 Python 2.0 "
89
+ "中,任意给定的时刻至多使用三个命名空间来查找变量名称:局部、模块和内置命名空间。 这往往会导致令人吃惊的结果因为它与人们直觉上的预期不相匹配。 "
90
+ "例如,一个嵌套的递归函数将不起作用::"
81
91
82
92
#: ../../whatsnew/2.1.rst:51
83
93
msgid ""
@@ -90,12 +100,16 @@ msgid ""
90
100
"find local variables being copied by passing them as the default values of "
91
101
"arguments. ::"
92
102
msgstr ""
103
+ "函数 :func:`g` 将总是引发 :exc:`NameError` 异常,因为名称 ``g`` 的绑定既不在局部命名空间中也不在模块级命名空间中。 "
104
+ "这在实践上不会有太大问题(你会经常这样递归地定义内部函数吗?),但是这也会让 :keyword:`lambda` "
105
+ "表达式的使用更为笨拙,这在实践上是有问题的。 在使用了 :keyword:`lambda` 的代码中你经常能发现局部变量通过作为参数的默认值被拷贝。 "
106
+ "::"
93
107
94
108
#: ../../whatsnew/2.1.rst:65
95
109
msgid ""
96
110
"The readability of Python code written in a strongly functional style "
97
111
"suffers greatly as a result."
98
- msgstr ""
112
+ msgstr "结果将会严重损害以高度函数式风格编写的 Python 代码的可读性。 "
99
113
100
114
#: ../../whatsnew/2.1.rst:68
101
115
msgid ""
@@ -109,6 +123,10 @@ msgid ""
109
123
"of the rules, and a dissection of the implementation, can be found in the "
110
124
"PEP."
111
125
msgstr ""
126
+ "Python 2.1 最显著的改变是增加了静态作用域这一语言特征来解决此问题。 作为它的第一项影响,在上述示例中的 ``name=name`` "
127
+ "默认参数现在将不再必要。 简单地说,当一个函数内部的给定变量名没有被赋值时(通过赋值语句,或者 :keyword:`def`, "
128
+ ":keyword:`class` 或 :keyword:`import` 语句),对该变量的引用将在外层作用域的局部命名空间中查找。 "
129
+ "对于该规则的更详细解释,以及具体实现的分析,请参阅相应的 PEP。"
112
130
113
131
#: ../../whatsnew/2.1.rst:77
114
132
msgid ""
@@ -118,6 +136,8 @@ msgid ""
118
136
"rather unlikely though, since such code would have been pretty confusing to "
119
137
"read in the first place."
120
138
msgstr ""
139
+ "对于同时在模块层级和包含下层函数定义的函数内部局部变量使用了相同变量名的代码来说这项改变可能会导致一些兼容性问题。 "
140
+ "不过这看来不太可能发生,因为阅读这样的代码本来就会相当令人困惑。"
121
141
122
142
#: ../../whatsnew/2.1.rst:83
123
143
msgid ""
@@ -135,6 +155,12 @@ msgid ""
135
155
"variables, the compiler will flag this by raising a :exc:`SyntaxError` "
136
156
"exception."
137
157
msgstr ""
158
+ "此项改变的一个附带影响是在特定条件下函数作用域内部 ``from module import *`` 和 ``exec`` 语句将不允许使用。 "
159
+ "Python 参考手册已经写明 ``from module import *`` 仅在模块最高层级上是可用的,但此前 CPython "
160
+ "解释器从未强制实施此规则。 作为嵌套作用域具体实现的一部分,将 Python 源码转为字节码的编译器会生成不同的代码来访问某个包含作用域内的变量。 "
161
+ "``from module import *`` 和 ``exec`` 会使得编译器无法正确执行,因为它们会向局部命名空间添加在编译时还不存在的名称。 "
162
+ "为此,如果一个函数包含带有自由变量的函数定义或 :keyword:`lambda` 表达式,编译器将通过引发 :exc:`SyntaxError` "
163
+ "异常来提示。"
138
164
139
165
#: ../../whatsnew/2.1.rst:96
140
166
msgid "To make the preceding explanation a bit clearer, here's an example::"
@@ -146,13 +172,15 @@ msgid ""
146
172
"would define a new local variable named ``x`` whose value should be accessed"
147
173
" by :func:`g`."
148
174
msgstr ""
175
+ "包含 ``exec`` 语句的第 4 行有语法错误,因为 ``exec`` 将定义一个名为 ``x`` 的新局部变量,它的值应当被 :func:`g` "
176
+ "访问。"
149
177
150
178
#: ../../whatsnew/2.1.rst:109
151
179
msgid ""
152
180
"This shouldn't be much of a limitation, since ``exec`` is rarely used in "
153
181
"most Python code (and when it is used, it's often a sign of a poor design "
154
182
"anyway)."
155
- msgstr ""
183
+ msgstr "这应该不会是太大的限制,因为 ``exec`` 在多数 Python 代码中都极少被使用(而当它被使用时,往往也是个存在糟糕设计的信号)。 "
156
184
157
185
#: ../../whatsnew/2.1.rst:113
158
186
msgid ""
@@ -378,7 +406,7 @@ msgstr ""
378
406
msgid ""
379
407
"For example, in Python 2.1 the :mod:`regex` module is deprecated, so "
380
408
"importing it causes a warning to be printed::"
381
- msgstr ""
409
+ msgstr "例如,在 Python 2.1 中 :mod:`regex` 模块已被弃用,因此导入它时会打印一条警告信息:: "
382
410
383
411
#: ../../whatsnew/2.1.rst:2
10000
56
384
412
msgid "Warnings can be issued by calling the :func:`warnings.warn` function::"
@@ -388,7 +416,7 @@ msgstr "警告可以通过调用 :func:`warnings.warn` 函数来发出::"
388
416
msgid ""
389
417
"The first parameter is the warning message; an additional optional "
390
418
"parameters can be used to specify a particular warning category."
391
- msgstr ""
419
+ msgstr "第一个形参是警告消息;额外的可选形参可被用来指定一个专门的警告类别。 "
392
420
393
421
#: ../../whatsnew/2.1.rst:263
394
422
msgid ""
@@ -630,7 +658,7 @@ msgstr ""
630
658
631
659
#: ../../whatsnew/2.1.rst:479
632
660
msgid "PEP 217: Interactive Display Hook"
633
- msgstr ""
661
+ msgstr "PEP 217: 交互模式显示钩子 "
634
662
635
663
#: ../../whatsnew/2.1.rst:481
636
664
msgid ""
@@ -643,15 +671,15 @@ msgstr ""
643
671
644
672
#: ../../whatsnew/2.1.rst:502
645
673
msgid ":pep:`217` - Display Hook for Interactive Use"
646
- msgstr ""
674
+ msgstr ":pep:`217` - 用于交互模式的显示钩子 "
647
675
648
676
#: ../../whatsnew/2.1.rst:503
649
677
msgid "Written and implemented by Moshe Zadka."
650
678
msgstr "由 Moshe Zadka 撰写并实现"
651
679
652
680
#: ../../whatsnew/2.1.rst:509
653
681
msgid "PEP 208: New Coercion Model"
654
- msgstr ""
682
+ msgstr "PEP 208: 新的强制转换模型 "
655
683
656
684
#: ../../whatsnew/2.1.rst:511
657
685
msgid ""
@@ -680,7 +708,7 @@ msgstr ""
680
708
681
709
#: ../../whatsnew/2.1.rst:534
682
710
msgid ":pep:`208` - Reworking the Coercion Model"
683
- msgstr ""
711
+ msgstr ":pep:`208` - 改写强制转换模型 "
684
712
685
713
#: ../../whatsnew/2.1.rst:533
686
714
msgid ""
@@ -691,7 +719,7 @@ msgstr ""
691
719
692
720
#: ../../whatsnew/2.1.rst:541
693
721
msgid "PEP 241: Metadata in Python Packages"
694
- msgstr ""
722
+ msgstr "PEP 241: Python 包中的元数据 "
695
723
696
724
#: ../../whatsnew/2.1.rst:543
697
725
msgid ""
@@ -730,17 +758,17 @@ msgstr ""
730
758
731
759
#: ../../whatsnew/2.1.rst:571
732
760
msgid ":pep:`241` - Metadata for Python Software Packages"
733
- msgstr ""
761
+ msgstr ":pep:`241` - 针对 Python 软件包的元数据 "
734
762
735
763
#: ../../whatsnew/2.1.rst:574
736
764
msgid ":pep:`243` - Module Repository Upload Mechanism"
737
- msgstr ""
765
+ msgstr ":pep:`243` - 模块仓库上传机制 "
738
766
739
767
#: ../../whatsnew/2.1.rst:574
740
768
msgid ""
741
769
"Written by Sean Reifschneider, this draft PEP describes a proposed mechanism"
742
770
" for uploading Python packages to a central server."
743
- msgstr ""
771
+ msgstr "由 Sean Reifschneider 撰写,这个 PEP 草案描述了用于将 Python 软件包上传到一个中心服务器的建议机制。 "
744
772
745
773
#: ../../whatsnew/2.1.rst:581
746
774
msgid "New and Improved Modules"
@@ -1016,6 +1044,8 @@ msgid ""
1016
1044
"edits, and other tweaks, too lengthy to be worth itemizing; see the CVS logs"
1017
1045
" for the full details if you want them."
1018
1046
msgstr ""
1047
+ "此外还有一份由次要的程序错误修复、次要的内存泄漏、文档字符串编辑和其他调整组成的常规清单,因过于冗长而不值得逐项列出;如果你想了解完整细节请参阅 CVS"
1048
+ " 日志。"
1019
1049
1020
1050
#: ../../whatsnew/2.1.rst:789
1021
1051
msgid "Acknowledgements"
0 commit comments