5
5
#
6
6
# Translators:
7
7
# Rafael Fontenelle <rffontenelle@gmail.com>, 2024
8
+ # Unknownuserfrommars, 2024
8
9
#
9
10
#, fuzzy
10
11
msgid ""
11
12
msgstr ""
12
13
"Project-Id-Version : Python 3.12\n "
13
14
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2024-05-11 19:07 +0000\n "
15
+ "POT-Creation-Date : 2024-05-31 14:49 +0000\n "
15
16
"PO-Revision-Date : 2024-05-11 00:34+0000\n "
16
- "Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com> , 2024\n "
17
+ "Last-Translator : Unknownuserfrommars , 2024\n "
17
18
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
18
19
"MIME-Version : 1.0\n "
19
20
"Content-Type : text/plain; charset=UTF-8\n "
@@ -110,13 +111,13 @@ msgstr "Python 2.2 修正了此问题,并在此过程中添加了一些令人
110
111
msgid ""
111
112
"You can subclass built-in types such as lists and even integers, and your "
112
113
"subclasses should work in every place that requires the original type."
113
- msgstr ""
114
+ msgstr "你可以继承内置类型,例如列表和整数,并且你的子类应该在任何需要原始类型的地方正常工作。这使得 Python 的面向对象编程更加灵活和强大。 "
114
115
115
116
#: ../../whatsnew/2.2.rst:67
116
117
msgid ""
117
118
"It's now possible to define static and class methods, in addition to the "
118
119
"instance methods available in previous versions of Python."
119
- msgstr ""
120
+ msgstr "现在,除了之前版本的 Python 中可用的实例方法外,还可以定义静态方法和类方法。这使得你可以更灵活地组织类的行为。 "
120
121
121
122
#: ../../whatsnew/2.2.rst:70
122
123
msgid ""
@@ -132,7 +133,7 @@ msgid ""
132
133
"The list of legal attributes for an instance can be limited to a particular "
133
134
"set using :dfn:`slots`, making it possible to safeguard against typos and "
134
135
"perhaps make more optimizations possible in future versions of Python."
135
- msgstr ""
136
+ msgstr "可以使用 __slots__ 限制实例的合法属性列表,从而防止拼写错误,并且在未来的 Python 版本中可能进行更多的优化。 "
136
137
137
138
#: ../../whatsnew/2.2.rst:80
138
139
msgid ""
@@ -143,6 +144,8 @@ msgid ""
143
144
"recommended Python for its simplicity, and feel that its simplicity is being"
144
145
" lost."
145
146
msgstr ""
147
+ "一些用户对这些变化表示担忧。确实,他们说,新功能很棒,可以实现以前版本的 Python "
148
+ "无法做到的各种技巧,但它们也使语言变得更加复杂。一些人表示,他们一直推荐 Python 是因为它的简单性,现在感觉这种简单性正在丧失。"
146
149
147
150
#: ../../whatsnew/2.2.rst:86
148
151
msgid ""
@@ -154,6 +157,9 @@ msgid ""
154
157
"only possible from C will now be possible in pure Python, and to my mind "
155
158
"that's all for the better."
156
159
msgstr ""
160
+ "个人而言,我认为没有必要担心。许多新功能相当深奥,你可以编写大量 Python "
161
+ "代码而不需要了解它们。编写一个简单的类并不比以前更难,因此除非确实需要,否则你不必费心去学习或教授这些新功能。一些以前只有在 C "
162
+ "语言中才能实现的非常复杂的任务,现在可以用纯 Python 实现,在我看来,这一切都更好了。"
157
163
158
164
#: ../../whatsnew/2.2.rst:93
159
165
msgid ""
@@ -163,6 +169,8 @@ msgid ""
163
169
"Links\" , for further sources of information about Python 2.2's new object "
164
170
"model."
165
171
msgstr ""
172
+ "我不会尝试涵盖所有为了使新功能生效而需要的每一个边缘情况和小改动。相反,本节将只勾勒出大致的轮廓。有关 Python 2.2 "
173
+ "新对象模型的更多信息,请参见 :ref:`sect-rellinks` 的“相关链接”部分。"
166
174
167
175
#: ../../whatsnew/2.2.rst:100
168
176
msgid "Old and New Classes"
@@ -177,6 +185,8 @@ msgid ""
177
185
"classes. This divergence isn't intended to last forever; eventually old-"
178
186
"style classes will be dropped, possibly in Python 3.0."
179
187
msgstr ""
188
+ "首先,你应该知道 Python 2.2 实际上有两种类型的类:经典类(或旧式类)和新式类。旧式类模型与早期版本的 Python "
189
+ "中的类模型完全相同。本节描述的所有新功能仅适用于新式类。这种分歧并不是永久的;最终,旧式类将被淘汰,可能在 Python 3.0 中被移除。"
180
190
181
191
#: ../../whatsnew/2.2.rst:109
182
192
msgid ""
@@ -244,12 +254,14 @@ msgid ""
244
254
"it's a method or a field. With the descriptor API, static methods and class"
245
255
" methods become possible, as well as more exotic constructs."
246
256
msgstr ""
257
+ "新类模型的一个核心理念是正式化了使用描述符来描述对象属性的 API。描述符指定属性的值,说明它是方法还是字段。通过描述符 "
258
+ "API,静态方法和类方法成为可能,以及其他更复杂的构造。"
247
259
248
260
#: ../../whatsnew/2.2.rst:169
249
261
msgid ""
250
262
"Attribute descriptors are objects that live inside class objects, and have a"
251
263
" few attributes of their own:"
252
- msgstr ""
264
+ msgstr "属性描述符是存在于类对象内部的对象,它们自身具有一些属性。描述符协议由三个主要方法组成: "
253
265
254
266
#: ../../whatsnew/2.2.rst:172
255
267
msgid ":attr:`~definition.__name__` is the attribute's name."
@@ -310,6 +322,9 @@ msgid ""
310
322
"and postconditions for a method. A class that used this feature might be "
311
323
"defined like this::"
312
324
msgstr ""
325
+ "更多的新功能,如 __slots__ "
326
+ "和属性,也作为新类型的描述符实现。编写一个实现新功能的描述符类并不困难。例如,可以编写一个描述符类,使其能够为方法编写类似 Eiffel "
327
+ "风格的前置条件和后置条件。使用该功能的类可能定义如下:"
313
328
314
329
#: ../../whatsnew/2.2.rst:235
315
330
msgid ""
@@ -351,6 +366,8 @@ msgid ""
351
366
"cases, but produces more useful results for really complicated inheritance "
352
367
"graphs.)"
353
368
msgstr ""
369
+ "新式类遵循一种不同的算法,虽然解释起来有点复杂,但在这种情况下能做正确的事情。(请注意,Python 2.3 "
370
+ "改变了这个算法,在大多数情况下会产生相同的结果,但对于非常复杂的继承图会产生更有用的结果。)"
354
371
355
372
#: ../../whatsnew/2.2.rst:277
356
373
msgid ""
@@ -480,7 +497,7 @@ msgid ""
480
497
"enough of an explanation to start you programming, but many details have "
481
498
"been simplified or ignored. Where should you go to get a more complete "
482
499
"picture?"
483
- msgstr ""
500
+ msgstr "本节只是对新特性进行了简要概述,提供了足够的解释以帮助你开始编程,但许多细节已被简化或忽略。想要获得更全面的了解,你可以去哪里呢? "
484
501
485
502
#: ../../whatsnew/2.2.rst:398
486
503
msgid ""
@@ -520,7 +537,7 @@ msgid ""
520
537
"Another significant addition to 2.2 is an iteration interface at both the C "
521
538
"and Python levels. Objects can define how they can be looped over by "
522
539
"callers."
523
- msgstr ""
540
+ msgstr "Python 2.2 的另一个重要新增功能是在 C 和 Python 两个层面上引入了迭代接口。对象可以定义如何被调用者循环遍历。 "
524
541
525
542
#: ../../whatsnew/2.2.rst:426
526
543
msgid ""
@@ -625,7 +642,7 @@ msgstr ":pep:`234` - 迭代器"
625
642
msgid ""
626
643
"Written by Ka-Ping Yee and GvR; implemented by the Python Labs crew, mostly"
627
644
" by GvR and Tim Peters."
628
- msgstr "由 Ka-Ping Yee 和 GvR 撰写;由 Python Labs 小组 (主要由 GvR 和 Tim Peters)实现。"
645
+ msgstr "由 Ka-Ping Yee 和 GvR 撰写;由 Python Labs 团队 (主要由 GvR 和 Tim Peters)实现。"
629
646
630
647
#: ../../whatsnew/2.2.rst:542
631
648
msgid "PEP 255: Simple Generators"
@@ -735,6 +752,10 @@ msgid ""
735
752
"Language\" at https://www2.cs.arizona.edu/icon/docs/ipd266.htm gives an idea"
736
753
" of what this looks like::"
737
754
msgstr ""
755
+ "生成器的概念源自其他编程语言,尤其是 Icon(https://www2.cs.arizona.edu/icon/ ),在 Icon "
756
+ "语言中,生成器的概念是核心。在 Icon 中,每个表达式和函数调用生成器的概念源自其他编程语言,尤其是 "
757
+ "Icon。在Icon中,每个表达式和函数调用都可以表现得像一个生成器。以下是来自“Icon 编程语言概述”中的一个示例,展示了生成器的用法 "
758
+ "https://www2.cs.arizona.edu/icon/docs/ipd266.htm :"
738
759
739
760
#: ../../whatsnew/2.2.rst:644
740
761
msgid ""
@@ -756,6 +777,9 @@ msgid ""
756
777
"represented as a concrete object (the iterator) that can be passed around to"
757
778
" other functions or stored in a data structure."
758
779
msgstr ""
780
+ "Python 并没有像 Icon 那样将生成器作为核心概念来采纳。生成器被认为是 Python "
781
+ "核心语言的一部分,但学习或使用它们并不是强制性的;如果它们不能解决你的问题,可以完全忽略它们。与 Icon 相比,Python "
782
+ "的一个新颖特性是生成器的状态表示为一个具体对象(迭代器),该对象可以传递给其他函数或存储在数据结构中。"
759
783
760
784
#: ../../whatsnew/2.2.rst:661
761
785
msgid ":pep:`255` - Simple Generators"
@@ -848,6 +872,7 @@ msgid ""
848
872
"Python 2.2 begins the transition, but the switch won't be complete until "
849
873
"Python 3.0."
850
874
msgstr ""
875
+ "由于这一变化可能会破坏现有代码,因此它正在非常逐步地引入。Python 2.2 开始了这一过渡,但直到 Python 3.0 这一转换才会完全完成。"
851
876
852
877
#: ../../whatsnew/2.2.rst:732
853
878
msgid ""
@@ -863,7 +888,7 @@ msgstr ""
863
888
864
889
#: ../../whatsnew/2.2.rst:740
865
890
msgid "Here are the changes 2.2 introduces:"
866
- msgstr ""
891
+ msgstr "Python 2.2 引入了以下变化: "
867
892
868
893
#: ../../whatsnew/2.2.rst:742
869
894
msgid ""
@@ -1003,6 +1028,9 @@ msgid ""
1003
1028
" their intuitive expectations. For example, a nested recursive function "
1004
1029
"definition doesn't work::"
1005
1030
msgstr ""
1031
+ "Python 2.1 中的最大改变是 Python 的作用域规则,在Python 2.2中得到完善。 在 Python 2.0 "
1032
+ "中,任意给定的时刻至多使用三个命名空间来查找变量名称:局部、模块和内置命名空间。 这往往会导致令人吃惊的结果因为它与人们直觉上的预期不相匹配。 "
1033
+ "例如,一个嵌套的递归函数将不起作用::"
1006
1034
1007
1035
#: ../../whatsnew/2.2.rst:862
1008
1036
msgid ""
@@ -1034,6 +1062,10 @@ msgid ""
1034
1062
"of the rules, and a dissection of the implementation, can be found in the "
1035
1063
"PEP."
1036
1064
msgstr ""
1065
+ "Python 2.2 最显著的改变是增加了静态作用域这一语言特征来解决此问题。 作为它的第一项影响,在上述示例中的 ``name=name`` "
1066
+ "默认参数现在将不再必要。 简单地说,当一个函数内部的给定变量名没有被赋值时(通过赋值语句,或者 :keyword:`def`, "
1067
+ ":keyword:`class` 或 :keyword:`import` 语句),对该变量的引用将在外层作用域的局部命名空间中查找。 "
1068
+ "对于该规则的更详细解释,以及具体实现的分析,请参阅相应的 PEP。"
1037
1069
1038
1070
#: ../../whatsnew/2.2.rst:888
1039
1071
msgid ""
@@ -1280,7 +1312,7 @@ msgstr ""
1280
1312
1281
1313
#: ../../whatsnew/2.2.rst:1065
1282
1314
msgid ""
1283
- "Another low-level API, primarily of interest to implementors of Python "
1315
+ "Another low-level API, primarily of interest to implementers of Python "
1284
1316
"debuggers and development tools, was added. "
1285
1317
":c:func:`PyInterpreterState_Head` and :c:func:`PyInterpreterState_Next` let "
1286
1318
"a caller walk through all the existing interpreter objects; "
0 commit comments