@@ -288,7 +288,7 @@ msgid ""
288288"assignment in expression construct much; it's only newcomers who express a "
289289"strong desire to add this to the language."
290290msgstr ""
291- "一个有趣的现象是,大多数有经验的Python程序员都认识到``while True``的习惯用法,也不太在意是否能在表达式构造中赋值; "
291+ "一个有趣的现象是,大多数有经验的Python程序员都认识到 ``while True`` 的习惯用法,也不太在意是否能在表达式构造中赋值; "
292292"只有新人表达了强烈的愿望希望将其添加到语言中。"
293293
294294#: ../../faq/design.rst:193
@@ -442,8 +442,8 @@ msgid ""
442442"getvalue(key))``, but only if the ``getvalue()`` call is cheap enough "
443443"because it is evaluated in all cases."
444444msgstr ""
445- "对于这种特定的情况,您还可以使用 ``value = dict.setdefault(key, "
446- "getvalue(key))``,但前提是调用 ``getvalue()`` 足够便宜,因为在所有情况下都会对其进行评估。"
445+ "对于这种特定的情况,您还可以使用 ``value = dict.setdefault(key, getvalue(key))``,但前提是调用 "
446+ "``getvalue()`` 足够便宜,因为在所有情况下都会对其进行评估。"
447447
448448#: ../../faq/design.rst:306
449449msgid "Why isn't there a switch or case statement in Python?"
@@ -494,7 +494,7 @@ msgid ""
494494"almost random moments. Therefore, a complete threads implementation "
495495"requires thread support for C."
496496msgstr ""
497- "答案1: 不幸的是,解释器为每个Python堆栈帧推送至少一个C堆栈帧。此外,扩展几乎随时回调Python 。因此,一个完整的线程实现需要对C的线程支持。"
497+ "答案1: 不幸的是,解释器为每个Python堆栈帧推送至少一个C堆栈帧。此外,扩展可以随时回调Python 。因此,一个完整的线程实现需要对C的线程支持。"
498498
499499#: ../../faq/design.rst:352
500500msgid ""
@@ -592,7 +592,7 @@ msgid ""
592592" those file objects will only get collected (and closed) at varying and "
593593"possibly long intervals."
594594msgstr ""
595- "实际上,使用CPython的引用计数和析构函数方案, 每个新赋值的*f* "
595+ "实际上,使用CPython的引用计数和析构函数方案, 每个新赋值的 *f* "
596596"都会关闭前一个文件。然而,对于传统的GC,这些文件对象只能以不同的时间间隔(可能很长的时间间隔)被收集(和关闭)。"
597597
598598#: ../../faq/design.rst:411
@@ -615,8 +615,8 @@ msgid ""
615615"transparent, it isn't completely transparent; patches are required to get "
616616"Python to work with it.)"
617617msgstr ""
618- "首先,这不是C标准特性,因此不能移植。(是的,我们知道Boehm "
619- "GC库。它包含了*大多数* 常见平台(但不是所有平台)的汇编代码,尽管它基本上是透明的,但也不是完全透明的; 要让Python使用它,需要使用补丁。)"
618+ "首先,这不是C标准特性,因此不能移植。(是的,我们知道Boehm GC库。它包含了 *大多数* "
619+ "常见平台(但不是所有平台)的汇编代码,尽管它基本上是透明的,但也不是完全透明的; 要让Python使用它,需要使用补丁。)"
620620
621621#: ../../faq/design.rst:429
622622msgid ""
@@ -691,7 +691,7 @@ msgstr ""
691691
692692#: ../../faq/design.rst:475
693693msgid "How are lists implemented in CPython?"
694- msgstr "如何在CPython中实现列表 ?"
694+ msgstr "列表是如何在CPython中实现的 ?"
695695
696696#: ../../faq/design.rst:477
697697msgid ""
@@ -720,7 +720,7 @@ msgstr ""
720720
721721#: ../../faq/design.rst:491
722722msgid "How are dictionaries implemented in CPython?"
723- msgstr "如何在CPython中实现字典 ?"
723+ msgstr "字典是如何在CPython中实现的 ?"
724724
725725#: ../../faq/design.rst:493
726726msgid ""
@@ -862,6 +862,8 @@ msgid ""
862862"when you need a sorted copy but also need to keep the unsorted version "
863863"around."
864864msgstr ""
865+ "在性能很重要的情况下,仅仅为了排序而复制一份列表将是一种浪费。因此, :meth:`list.sort` "
866+ "对列表进行了适当的排序。为了提醒您这一事实,它不会返回已排序的列表。这样,当您需要排序的副本,但也需要保留未排序的版本时,就不会意外地覆盖列表。"
865867
866868#: ../../faq/design.rst:598
867869msgid ""
@@ -943,12 +945,14 @@ msgid ""
943945"all reasonable uses of the \" go\" or \" goto\" constructs of C, Fortran, and "
944946"other languages. For example::"
945947msgstr ""
948+ "可以使用异常捕获来提供 “goto结构” ,甚至可以跨函数调用工作的 。许多人认为异常捕获可以方便地模拟C,Fortran和其他语言的 \" go\" 或"
949+ " \" goto\" 结构的所有合理用法。例如::"
946950
947951#: ../../faq/design.rst:667
948952msgid ""
949953"This doesn't allow you to jump into the middle of a loop, but that's usually"
950954" considered an abuse of goto anyway. Use sparingly."
951- msgstr ""
955+ msgstr "但是不允许你跳到循环的中间,这通常被认为是滥用goto。谨慎使用。 "
952956
953957#: ../../faq/design.rst:672
954958msgid "Why can't raw strings (r-strings) end with a backslash?"
@@ -959,7 +963,7 @@ msgid ""
959963"More precisely, they can't end with an odd number of backslashes: the "
960964"unpaired backslash at the end escapes the closing quote character, leaving "
961965"an unterminated string."
962- msgstr ""
966+ msgstr "更准确地说,它们不能以奇数个反斜杠结束:结尾处的不成对反斜杠会转义结束引号字符,留下未结束的字符串。 "
963967
964968#: ../../faq/design.rst:678
965969msgid ""
@@ -970,17 +974,19 @@ msgid ""
970974" pass on the string quote character by escaping it with a backslash. These "
971975"rules work well when r-strings are used for their intended purpose."
972976msgstr ""
977+ "原始字符串的设计是为了方便想要执行自己的反斜杠转义处理的处理器(主要是正则表达式引擎)创建输入。此类处理器将不匹配的尾随反斜杠视为错误,因此原始字符串不允许这样做。反过来,允许通过使用引号字符转义反斜杠转义字符串"
978+ "。当r-string用于它们的预期目的时,这些规则工作的很好。"
973979
974980#: ../../faq/design.rst:685
975981msgid ""
976982"If you're trying to build Windows pathnames, note that all Windows system "
977983"calls accept forward slashes too::"
978- msgstr ""
984+ msgstr "如果您正在尝试构建Windows路径名,请注意所有Windows系统调用都使用正斜杠:: "
979985
980986#: ../../faq/design.rst:690
981987msgid ""
982988"If you're trying to build a pathname for a DOS command, try e.g. one of ::"
983- msgstr ""
989+ msgstr "如果您正在尝试为DOS命令构建路径名,请尝试以下示例 :: "
984990
985991#: ../../faq/design.rst:698
986992msgid "Why doesn't Python have a \" with\" statement for attribute assignments?"
@@ -1053,26 +1059,26 @@ msgstr "为什么 if/while/def/class语句需要冒号? "
10531059msgid ""
10541060"The colon is required primarily to enhance readability (one of the results "
10551061"of the experimental ABC language). Consider this::"
1056- msgstr ""
1062+ msgstr "冒号主要用于增强可读性(ABC语言实验的结果之一)。考虑一下这个:: "
10571063
10581064#: ../../faq/design.rst:761
10591065msgid "versus ::"
1060- msgstr ""
1066+ msgstr "与 :: "
10611067
10621068#: ../../faq/design.rst:766
10631069msgid ""
10641070"Notice how the second one is slightly easier to read. Notice further how a "
10651071"colon sets off the example in this FAQ answer; it's a standard usage in "
10661072"English."
1067- msgstr ""
1073+ msgstr "注意第二种方法稍微容易一些。请进一步注意,在这个FAQ解答的示例中,冒号是如何设置的;这是英语中的标准用法。 "
10681074
10691075#: ../../faq/design.rst:769
10701076msgid ""
10711077"Another minor reason is that the colon makes it easier for editors with "
10721078"syntax highlighting; they can look for colons to decide when indentation "
10731079"needs to be increased instead of having to do a more elaborate parsing of "
10741080"the program text."
1075- msgstr ""
1081+ msgstr "另一个次要原因是冒号使带有语法突出显示的编辑器更容易工作;他们可以寻找冒号来决定何时需要增加缩进,而不必对程序文本进行更精细的解析。 "
10761082
10771083#: ../../faq/design.rst:775
10781084msgid "Why does Python allow commas at the end of lists and tuples?"
@@ -1082,35 +1088,35 @@ msgstr "为什么Python在列表和元组的末尾允许使用逗号?"
10821088msgid ""
10831089"Python lets you add a trailing comma at the end of lists, tuples, and "
10841090"dictionaries::"
1085- msgstr ""
1091+ msgstr "Python 允许您在列表,元组和字典的末尾添加一个尾随逗号:: "
10861092
10871093#: ../../faq/design.rst:788
10881094msgid "There are several reasons to allow this."
1089- msgstr ""
1095+ msgstr "有几个理由允许这样做。 "
10901096
10911097#: ../../faq/design.rst:790
10921098msgid ""
10931099"When you have a literal value for a list, tuple, or dictionary spread across"
10941100" multiple lines, it's easier to add more elements because you don't have to "
10951101"remember to add a comma to the previous line. The lines can also be "
10961102"reordered without creating a syntax error."
1097- msgstr ""
1103+ msgstr "如果列表,元组或字典的字面值分布在多行中,则更容易添加更多元素,因为不必记住在上一行中添加逗号。这些行也可以重新排序,而不会产生语法错误。 "
10981104
10991105#: ../../faq/design.rst:795
11001106msgid ""
11011107"Accidentally omitting the comma can lead to errors that are hard to "
11021108"diagnose. For example::"
1103- msgstr ""
1109+ msgstr "不小心省略逗号会导致难以诊断的错误。例如:: "
11041110
11051111#: ../../faq/design.rst:805
11061112msgid ""
11071113"This list looks like it has four elements, but it actually contains three: "
11081114"\" fee\" , \" fiefoo\" and \" fum\" . Always adding the comma avoids this source"
11091115" of error."
1110- msgstr ""
1116+ msgstr "这个列表看起来有四个元素,但实际上包含三个 : \" fee \" , \" fiefoo \" 和 \" fum \" 。总是加上逗号可以避免这个错误的来源。 "
11111117
11121118#: ../../faq/design.rst:808
11131119msgid ""
11141120"Allowing the trailing comma may also make programmatic code generation "
11151121"easier."
1116- msgstr ""
1122+ msgstr "允许尾随逗号也可以使生成编程代码更容易。 "
0 commit comments