@@ -613,10 +613,14 @@ msgid ""
613613"they occur all their leading whitespace should be stripped. Equivalence of "
614614"whitespace should be tested after expansion of tabs (to 8 spaces, normally)."
615615msgstr ""
616+ "Python解析器不会从Python中删除多行字符串文字的缩进,因此处理文档的工具必须在需要时删除缩进。这是使用以下约定完成的。文档字符串第一行 "
617+ "*之后* "
618+ "的第一个非空行确定整个文档字符串的缩进量。(我们不能使用第一行,因为它通常与字符串的开头引号相邻,因此它的缩进在字符串文字中不明显。)然后从字符串的所有行的开头剥离与该缩进"
619+ " \" 等效\" 的空格。 缩进的行不应该出现,但是如果它们出现,则应该剥离它们的所有前导空格。应在扩展标签后测试空白的等效性(通常为8个空格)。"
616620
617621#: ../../tutorial/controlflow.rst:655
618622msgid "Here is an example of a multi-line docstring::"
619- msgstr ""
623+ msgstr "下面是一个多行文档字符串的例子:: "
620624
621625#: ../../tutorial/controlflow.rst:673
622626msgid "Function Annotations"
@@ -628,6 +632,8 @@ msgid ""
628632"information about the types used by user-defined functions (see :pep:`3107` "
629633"and :pep:`484` for more information)."
630634msgstr ""
635+ ":ref:`Function annotations <function>` 是关于用户自定义函数中使用的类型的完全可选元数据信息(有关更多信息,请参阅"
636+ " :pep:`3107` 和 :pep:`484` )。"
631637
632638#: ../../tutorial/controlflow.rst:685
633639msgid ""
@@ -640,10 +646,14 @@ msgid ""
640646" :keyword:`def` statement. The following example has a positional argument,"
641647" a keyword argument, and the return value annotated::"
642648msgstr ""
649+ "注解以字典的形式存储在函数的 :attr:`__annotations__` "
650+ "属性中,对函数的任何其他部分都没有影响。参数注解是由参数名称后面的冒号定义的,后面跟随一个用于表示注解值的表达式。返回值注解是由符号 ``->`` "
651+ "定义的,后面跟随一个表达式,在参数列表和表示 :keyword:`def` "
652+ "语句结束的冒号之间。下面的例子有一个位置参数,一个关键字参数,和返回值注解::"
643653
644654#: ../../tutorial/controlflow.rst:707
645655msgid "Intermezzo: Coding Style"
646- msgstr "小插曲: 编码风格"
656+ msgstr "小插曲: 编码风格"
647657
648658#: ../../tutorial/controlflow.rst:712
649659msgid ""
@@ -653,6 +663,8 @@ msgid ""
653663"than others. Making it easy for others to read your code is always a good "
654664"idea, and adopting a nice coding style helps tremendously for that."
655665msgstr ""
666+ "现在你将要写更长,更复杂的Python代码,是时候讨论一下 "
667+ "*代码风格*。大多数语言都能使用不同的风格编写(或更简洁,格式化的);有些比其他的更具有可读性。能让其他人轻松阅读你的代码总是一个好主意,采用一种好的编码风格对此有很大帮助。"
656668
657669#: ../../tutorial/controlflow.rst:718
658670msgid ""
@@ -661,27 +673,29 @@ msgid ""
661673" Python developer should read it at some point; here are the most important "
662674"points extracted for you:"
663675msgstr ""
676+ "对于Python,:pep:`8` "
677+ "已经成为大多数项目所遵循的风格指南;它促进了一种非常易读且令人赏心悦目的编码风格。每个Python开发人员都应该在某个时候阅读它;以下是为你提取的最重要的几个要点:"
664678
665679#: ../../tutorial/controlflow.rst:723
666680msgid "Use 4-space indentation, and no tabs."
667- msgstr ""
681+ msgstr "使用4个空格缩进,不要使用制表符。 "
668682
669683#: ../../tutorial/controlflow.rst:725
670684msgid ""
671685"4 spaces are a good compromise between small indentation (allows greater "
672686"nesting depth) and large indentation (easier to read). Tabs introduce "
673687"confusion, and are best left out."
674- msgstr ""
688+ msgstr "4个空格是一个在小缩进(允许更大的嵌套深度)和大缩进(更容易阅读)的一种很好的折中方案。制表符会引入混乱,最好不要使用它。 "
675689
676690#: ../../tutorial/controlflow.rst:729
677691msgid "Wrap lines so that they don't exceed 79 characters."
678- msgstr ""
692+ msgstr "换行,使一行不超过79个字符。 "
679693
680694#: ../../tutorial/controlflow.rst:731
681695msgid ""
682696"This helps users with small displays and makes it possible to have several "
683697"code files side-by-side on larger displays."
684- msgstr ""
698+ msgstr "这有助于使用小型显示器的用户,并且可以在较大的显示器上并排放置多个代码文件。 "
685699
686700#: ../../tutorial/controlflow.rst:734
687701msgid ""
0 commit comments