55#
66# Translators:
77# Rafael Fontenelle <[email protected] >, 20248+ # Unknownuserfrommars, 2024
89#
910#, fuzzy
1011msgid ""
1112msgstr ""
1213"Project-Id-Version : Python 3.12\n "
1314"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 "
1516"PO-Revision-Date : 2024-05-11 00:34+0000\n "
16- "
Last-Translator :
Rafael Fontenelle <[email protected] > , 2024\n"
17+ "Last-Translator : Unknownuserfrommars , 2024\n "
1718"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
1819"MIME-Version : 1.0\n "
1920"Content-Type : text/plain; charset=UTF-8\n "
@@ -110,13 +111,13 @@ msgstr "Python 2.2 修正了此问题,并在此过程中添加了一些令人
110111msgid ""
111112"You can subclass built-in types such as lists and even integers, and your "
112113"subclasses should work in every place that requires the original type."
113- msgstr ""
114+ msgstr "你可以继承内置类型,例如列表和整数,并且你的子类应该在任何需要原始类型的地方正常工作。这使得 Python 的面向对象编程更加灵活和强大。 "
114115
115116#: ../../whatsnew/2.2.rst:67
116117msgid ""
117118"It's now possible to define static and class methods, in addition to the "
118119"instance methods available in previous versions of Python."
119- msgstr ""
120+ msgstr "现在,除了之前版本的 Python 中可用的实例方法外,还可以定义静态方法和类方法。这使得你可以更灵活地组织类的行为。 "
120121
121122#: ../../whatsnew/2.2.rst:70
122123msgid ""
@@ -132,7 +133,7 @@ msgid ""
132133"The list of legal attributes for an instance can be limited to a particular "
133134"set using :dfn:`slots`, making it possible to safeguard against typos and "
134135"perhaps make more optimizations possible in future versions of Python."
135- msgstr ""
136+ msgstr "可以使用 __slots__ 限制实例的合法属性列表,从而防止拼写错误,并且在未来的 Python 版本中可能进行更多的优化。 "
136137
137138#: ../../whatsnew/2.2.rst:80
138139msgid ""
@@ -143,6 +144,8 @@ msgid ""
143144"recommended Python for its simplicity, and feel that its simplicity is being"
144145" lost."
145146msgstr ""
147+ "一些用户对这些变化表示担忧。确实,他们说,新功能很棒,可以实现以前版本的 Python "
148+ "无法做到的各种技巧,但它们也使语言变得更加复杂。一些人表示,他们一直推荐 Python 是因为它的简单性,现在感觉这种简单性正在丧失。"
146149
147150#: ../../whatsnew/2.2.rst:86
148151msgid ""
@@ -154,6 +157,9 @@ msgid ""
154157"only possible from C will now be possible in pure Python, and to my mind "
155158"that's all for the better."
156159msgstr ""
160+ "个人而言,我认为没有必要担心。许多新功能相当深奥,你可以编写大量 Python "
161+ "代码而不需要了解它们。编写一个简单的类并不比以前更难,因此除非确实需要,否则你不必费心去学习或教授这些新功能。一些以前只有在 C "
162+ "语言中才能实现的非常复杂的任务,现在可以用纯 Python 实现,在我看来,这一切都更好了。"
157163
158164#: ../../whatsnew/2.2.rst:93
159165msgid ""
@@ -163,6 +169,8 @@ msgid ""
163169"Links\" , for further sources of information about Python 2.2's new object "
164170"model."
165171msgstr ""
172+ "我不会尝试涵盖所有为了使新功能生效而需要的每一个边缘情况和小改动。相反,本节将只勾勒出大致的轮廓。有关 Python 2.2 "
173+ "新对象模型的更多信息,请参见 :ref:`sect-rellinks` 的“相关链接”部分。"
166174
167175#: ../../whatsnew/2.2.rst:100
168176msgid "Old and New Classes"
@@ -177,6 +185,8 @@ msgid ""
177185"classes. This divergence isn't intended to last forever; eventually old-"
178186"style classes will be dropped, possibly in Python 3.0."
179187msgstr ""
188+ "首先,你应该知道 Python 2.2 实际上有两种类型的类:经典类(或旧式类)和新式类。旧式类模型与早期版本的 Python "
189+ "中的类模型完全相同。本节描述的所有新功能仅适用于新式类。这种分歧并不是永久的;最终,旧式类将被淘汰,可能在 Python 3.0 中被移除。"
180190
181191#: ../../whatsnew/2.2.rst:109
182192msgid ""
@@ -244,12 +254,14 @@ msgid ""
244254"it's a method or a field. With the descriptor API, static methods and class"
245255" methods become possible, as well as more exotic constructs."
246256msgstr ""
257+ "新类模型的一个核心理念是正式化了使用描述符来描述对象属性的 API。描述符指定属性的值,说明它是方法还是字段。通过描述符 "
258+ "API,静态方法和类方法成为可能,以及其他更复杂的构造。"
247259
248260#: ../../whatsnew/2.2.rst:169
249261msgid ""
250262"Attribute descriptors are objects that live inside class objects, and have a"
251263" few attributes of their own:"
252- msgstr ""
264+ msgstr "属性描述符是存在于类对象内部的对象,它们自身具有一些属性。描述符协议由三个主要方法组成: "
253265
254266#: ../../whatsnew/2.2.rst:172
255267msgid ":attr:`~definition.__name__` is the attribute's name."
@@ -310,6 +322,9 @@ msgid ""
310322"and postconditions for a method. A class that used this feature might be "
311323"defined like this::"
312324msgstr ""
325+ "更多的新功能,如 __slots__ "
326+ "和属性,也作为新类型的描述符实现。编写一个实现新功能的描述符类并不困难。例如,可以编写一个描述符类,使其能够为方法编写类似 Eiffel "
327+ "风格的前置条件和后置条件。使用该功能的类可能定义如下:"
313328
314329#: ../../whatsnew/2.2.rst:235
315330msgid ""
@@ -351,6 +366,8 @@ msgid ""
351366"cases, but produces more useful results for really complicated inheritance "
352367"graphs.)"
353368msgstr ""
369+ "新式类遵循一种不同的算法,虽然解释起来有点复杂,但在这种情况下能做正确的事情。(请注意,Python 2.3 "
370+ "改变了这个算法,在大多数情况下会产生相同的结果,但对于非常复杂的继承图会产生更有用的结果。)"
354371
355372#: ../../whatsnew/2.2.rst:277
356373msgid ""
@@ -480,7 +497,7 @@ msgid ""
480497"enough of an explanation to start you programming, but many details have "
481498"been simplified or ignored. Where should you go to get a more complete "
482499"picture?"
483- msgstr ""
500+ msgstr "本节只是对新特性进行了简要概述,提供了足够的解释以帮助你开始编程,但许多细节已被简化或忽略。想要获得更全面的了解,你可以去哪里呢? "
484501
485502#: ../../whatsnew/2.2.rst:398
486503msgid ""
@@ -520,7 +537,7 @@ msgid ""
520537"Another significant addition to 2.2 is an iteration interface at both the C "
521538"and Python levels. Objects can define how they can be looped over by "
522539"callers."
523- msgstr ""
540+ msgstr "Python 2.2 的另一个重要新增功能是在 C 和 Python 两个层面上引入了迭代接口。对象可以定义如何被调用者循环遍历。 "
524541
525542#: ../../whatsnew/2.2.rst:426
526543msgid ""
@@ -625,7 +642,7 @@ msgstr ":pep:`234` - 迭代器"
625642msgid ""
626643"Written by Ka-Ping Yee and GvR; implemented by the Python Labs crew, mostly"
627644" 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)实现。"
629646
630647#: ../../whatsnew/2.2.rst:542
631648msgid "PEP 255: Simple Generators"
@@ -735,6 +752,10 @@ msgid ""
735752"Language\" at https://www2.cs.arizona.edu/icon/docs/ipd266.htm gives an idea"
736753" of what this looks like::"
737754msgstr ""
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 :"
738759
739760#: ../../whatsnew/2.2.rst:644
740761msgid ""
@@ -756,6 +777,9 @@ msgid ""
756777"represented as a concrete object (the iterator) that can be passed around to"
757778" other functions or stored in a data structure."
758779msgstr ""
780+ "Python 并没有像 Icon 那样将生成器作为核心概念来采纳。生成器被认为是 Python "
781+ "核心语言的一部分,但学习或使用它们并不是强制性的;如果它们不能解决你的问题,可以完全忽略它们。与 Icon 相比,Python "
782+ "的一个新颖特性是生成器的状态表示为一个具体对象(迭代器),该对象可以传递给其他函数或存储在数据结构中。"
759783
760784#: ../../whatsnew/2.2.rst:661
761785msgid ":pep:`255` - Simple Generators"
@@ -848,6 +872,7 @@ msgid ""
848872"Python 2.2 begins the transition, but the switch won't be complete until "
849873"Python 3.0."
850874msgstr ""
875+ "由于这一变化可能会破坏现有代码,因此它正在非常逐步地引入。Python 2.2 开始了这一过渡,但直到 Python 3.0 这一转换才会完全完成。"
851876
852877#: ../../whatsnew/2.2.rst:732
853878msgid ""
@@ -863,7 +888,7 @@ msgstr ""
863888
864889#: ../../whatsnew/2.2.rst:740
865890msgid "Here are the changes 2.2 introduces:"
866- msgstr ""
891+ msgstr "Python 2.2 引入了以下变化: "
867892
868893#: ../../whatsnew/2.2.rst:742
869894msgid ""
@@ -1003,6 +1028,9 @@ msgid ""
10031028" their intuitive expectations. For example, a nested recursive function "
10041029"definition doesn't work::"
10051030msgstr ""
1031+ "Python 2.1 中的最大改变是 Python 的作用域规则,在Python 2.2中得到完善。 在 Python 2.0 "
1032+ "中,任意给定的时刻至多使用三个命名空间来查找变量名称:局部、模块和内置命名空间。 这往往会导致令人吃惊的结果因为它与人们直觉上的预期不相匹配。 "
1033+ "例如,一个嵌套的递归函数将不起作用::"
10061034
10071035#: ../../whatsnew/2.2.rst:862
10081036msgid ""
@@ -1034,6 +1062,10 @@ msgid ""
10341062"of the rules, and a dissection of the implementation, can be found in the "
10351063"PEP."
10361064msgstr ""
1065+ "Python 2.2 最显著的改变是增加了静态作用域这一语言特征来解决此问题。 作为它的第一项影响,在上述示例中的 ``name=name`` "
1066+ "默认参数现在将不再必要。 简单地说,当一个函数内部的给定变量名没有被赋值时(通过赋值语句,或者 :keyword:`def`, "
1067+ ":keyword:`class` 或 :keyword:`import` 语句),对该变量的引用将在外层作用域的局部命名空间中查找。 "
1068+ "对于该规则的更详细解释,以及具体实现的分析,请参阅相应的 PEP。"
10371069
10381070#: ../../whatsnew/2.2.rst:888
10391071msgid ""
@@ -1280,7 +1312,7 @@ msgstr ""
12801312
12811313#: ../../whatsnew/2.2.rst:1065
12821314msgid ""
1283- "Another low-level API, primarily of interest to implementors of Python "
1315+ "Another low-level API, primarily of interest to implementers of Python "
12841316"debuggers and development tools, was added. "
12851317":c:func:`PyInterpreterState_Head` and :c:func:`PyInterpreterState_Next` let "
12861318"a caller walk through all the existing interpreter objects; "
0 commit comments