@@ -1063,13 +1063,13 @@ msgstr "我如何获得 int 字面属性而不是 SyntaxError ?"
10631063msgid ""
10641064"Trying to lookup an ``int`` literal attribute in the normal manner gives a "
10651065"syntax error because the period is seen as a decimal point::"
1066- msgstr ""
1066+ msgstr "试图以正常方式查询一个 ``int`` 字头的属性,会出现语法错误,因为句号被看成是小数点:: "
10671067
10681068#: ../../faq/programming.rst:851
10691069msgid ""
10701070"The solution is to separate the literal from the period with either a space "
10711071"or parentheses."
1072- msgstr ""
1072+ msgstr "解决办法是用空格或括号将字词与句号分开。 "
10731073
10741074#: ../../faq/programming.rst:861
10751075msgid "How do I convert a string to a number?"
@@ -2220,6 +2220,8 @@ msgid ""
22202220"guaranteed to be distinct from other objects. For example, here is how to "
22212221"implement a method that behaves like :meth:`dict.pop`::"
22222222msgstr ""
2223+ "2) 当 ``None`` 是一个有效的输入值时,检测可选参数可能很棘手。 在这些情况下,你可以创建一个单例哨兵对象,保证与其他对象不同。 "
2224+ "例如,这里是如何实现一个方法,其行为类似于 :meth:`dict.pop` :"
22232225
22242226#: ../../faq/programming.rst:1837
22252227msgid ""
@@ -2238,7 +2240,7 @@ msgstr "例如,以下是 :meth:`collections.abc.Sequence.__contains__` 的实
22382240#: ../../faq/programming.rst:1852
22392241msgid ""
22402242"How can a subclass control what data is stored in an immutable instance?"
2241- msgstr ""
2243+ msgstr "一个子类如何控制哪些数据被存储在一个不可变的实例中? "
22422244
22432245#: ../../faq/programming.rst:1854
22442246msgid ""
@@ -2247,16 +2249,18 @@ msgid ""
22472249"instance is created, which is too late to alter data in an immutable "
22482250"instance."
22492251msgstr ""
2252+ "当子类化一个不可变的类型时,重写 :meth:`__new__` 方法,而不是 :meth:`__init__` 方法。 "
2253+ "后者只在一个实例被创建之后运行,这对于改变一个不可变的实例中的数据来说太晚了。"
22502254
22512255#: ../../faq/programming.rst:1859
22522256msgid ""
22532257"All of these immutable classes have a different signature than their parent "
22542258"class:"
2255- msgstr ""
2259+ msgstr "所有这些不可变的类都有一个与它们的父类不同的签名: "
22562260
22572261#: ../../faq/programming.rst:1885
22582262msgid "The classes can be used like this:"
2259- msgstr ""
2263+ msgstr "这些类可以这样使用: "
22602264
22612265#: ../../faq/programming.rst:1900
22622266msgid "How do I cache method calls?"
@@ -2286,7 +2290,7 @@ msgid ""
22862290"result will be released right away. The disadvantage is that if instances "
22872291"accumulate, so too will the accumulated method results. They can grow "
22882292"without bound."
2289- msgstr ""
2293+ msgstr "其优点是,当一个实例不再被使用时,缓存的方法结果将被立即释放。缺点是,如果实例累积起来,累积的方法结果也会增加。它们可以无限制地增长。 "
22902294
22912295#: ../../faq/programming.rst:1916
22922296msgid ""
@@ -2539,7 +2543,7 @@ msgstr "本模块的功能代码(包括根据导入值进行初始化的全局
25392543msgid ""
25402544"Van Rossum doesn't like this approach much because the imports appear in a "
25412545"strange place, but it does work."
2542- msgstr ""
2546+ msgstr "Van Rossum 不太喜欢这种方法,因为import出现在一个奇怪的地方,但它确实有效。 "
25432547
25442548#: ../../faq/programming.rst:2098
25452549msgid ""
0 commit comments