@@ -1568,7 +1568,7 @@ msgstr ""
15681568msgid ""
15691569"It is the assignment part of the operation that produces the error, since a "
15701570"tuple is immutable."
1571- msgstr ""
1571+ msgstr "由于元组是不可变的,因此操作的赋值部分会产生错误。 "
15721572
15731573#: ../../faq/programming.rst:1309
15741574msgid "When you write something like::"
@@ -1592,7 +1592,7 @@ msgstr ""
15921592
15931593#: ../../faq/programming.rst:1335
15941594msgid "This is equivalent to::"
1595- msgstr ""
1595+ msgstr "这相当于:: "
15961596
15971597#: ../../faq/programming.rst:1340
15981598msgid ""
@@ -1604,7 +1604,7 @@ msgstr ""
16041604
16051605#: ../../faq/programming.rst:1345
16061606msgid "Thus, in our tuple example what is happening is equivalent to::"
1607- msgstr ""
1607+ msgstr "因此,在我们的元组示例中,发生的事情等同于: "
16081608
16091609#: ../../faq/programming.rst:1353
16101610msgid ""
@@ -1654,6 +1654,9 @@ msgid ""
16541654"\" result.append\" requires an extra attribute lookup, and third, there's a "
16551655"speed reduction from having to make all those function calls."
16561656msgstr ""
1657+ "如果你觉得这个更容易读懂,那么你可能更喜欢使用这个而不是前面的列表推导。然而,对于长列表来说,它的速度几乎是原来的两倍。为什么?首先, "
1658+ "``append()`` 操作必须重新分配内存,虽然它使用了一些技巧来避免每次都这样做,但它仍然偶尔需要这样做,而且代价相当高。第二,表达式 "
1659+ "\" result.append\" 需要额外的属性查找。第三,必须执行所有这些函数调用会降低速度。"
16571660
16581661#: ../../faq/programming.rst:1401
16591662msgid "Objects"
@@ -1743,7 +1746,7 @@ msgstr ""
17431746msgid ""
17441747"A better approach is to define a ``search()`` method on all the classes and "
17451748"just call it::"
1746- msgstr ""
1749+ msgstr "更好的方法是在所有类上定义一个 ``search()`` 方法,然后调用它: "
17471750
17481751#: ../../faq/programming.rst:1479
17491752msgid "What is delegation?"
@@ -1837,13 +1840,13 @@ msgstr "如何创建静态类数据和静态类方法?"
18371840msgid ""
18381841"Both static data and static methods (in the sense of C++ or Java) are "
18391842"supported in Python."
1840- msgstr ""
1843+ msgstr "Python支持静态数据和静态方法(在C ++或Java的意义上)。 "
18411844
18421845#: ../../faq/programming.rst:1563
18431846msgid ""
18441847"For static data, simply define a class attribute. To assign a new value to "
18451848"the attribute, you have to explicitly use the class name in the assignment::"
1846- msgstr ""
1849+ msgstr "对于静态数据,只需定义一个类属性。要为属性分配新值,就必须在赋值中显式使用类名: "
18471850
18481851#: ../../faq/programming.rst:1575
18491852msgid ""
@@ -1862,19 +1865,19 @@ msgstr ""
18621865
18631866#: ../../faq/programming.rst:1586
18641867msgid "Static methods are possible::"
1865- msgstr ""
1868+ msgstr "静态方法是可行的: "
18661869
18671870#: ../../faq/programming.rst:1594
18681871msgid ""
18691872"However, a far more straightforward way to get the effect of a static method"
18701873" is via a simple module-level function::"
1871- msgstr ""
1874+ msgstr "然而,获得静态方法效果的更直接的方法是通过一个简单的模块级函数: "
18721875
18731876#: ../../faq/programming.rst:1600
18741877msgid ""
18751878"If your code is structured so as to define one class (or tightly related "
18761879"class hierarchy) per module, this supplies the desired encapsulation."
1877- msgstr ""
1880+ msgstr "如果您的代码是结构化的,以便为每个模块定义一个类(或紧密相关的类层次结构),那么这就提供了所需的封装。 "
18781881
18791882#: ../../faq/programming.rst:1605
18801883msgid "How can I overload constructors (or methods) in Python?"
0 commit comments