33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
6+ # Translators:
7+ # Jerry Chen <[email protected] >, 20178+ # Shengjing Zhu <[email protected] >, 20189+ # Junkai Shao <[email protected] >, 201810+ # ww song <[email protected] >, 201811+ #
612#, fuzzy
713msgid ""
814msgstr ""
915"Project-Id-Version : Python 3.7\n "
1016"Report-Msgid-Bugs-To : \n "
11- "POT-Creation-Date : 2018-10-21 09:32 +0900\n "
12- "PO-Revision-Date : YEAR-MO-DA HO:MI+ZONE \n "
17+ "POT-Creation-Date : 2018-11-08 09:41 +0900\n "
18+ "PO-Revision-Date : 2017-02-16 23:39+0000 \n "
1319"
Last-Translator :
ww song <[email protected] >, 2018\n "
1420"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
1521"MIME-Version : 1.0\n "
@@ -30,7 +36,7 @@ msgid ""
3036"attributes attached to it for maintaining its state. Class instances can "
3137"also have methods (defined by its class) for modifying its state."
3238msgstr ""
33- "类提供了一种组合数据和功能的方法。创建一个新类意味着创建一个新的对象 *类型* ,并且可以创建一个该新类型的 *实例* "
39+ "类提供了一种组合数据和功能的方法。创建一个新类意味着创建一个新 *类型* 的对象,从而允许创建一个该类型的新 *实例* "
3440"。每个类的实例可以拥有保存自己状态的属性。一个类的实例也可以有改变自己状态的(定义在类中的)方法。"
3541
3642#: ../../tutorial/classes.rst:13
@@ -99,8 +105,8 @@ msgid ""
99105"the caller will see the change --- this eliminates the need for two "
100106"different argument passing mechanisms as in Pascal."
101107msgstr ""
102- "对象具有个性,多个名称(在多个范围内 )可以绑定到同一个对象。这在其他语言中称为别名。乍一看Python时通常不会理解这一点,在处理不可变的基本类型(数字,字符串,元组)时可以安全地忽略它。但是,别名对涉及可变对象,如,列表, 字典和大多数其他类型,的Python代码的语义可能会产生惊人的影响。这通常用于程序的好处,因为别名在某些方面表现得像指针。例如,传递一个对象很便宜,因为实现只传递一个指针; 如果函数修改了作为参数传递的对象,调用者将看到更改"
103- "---这消除了对Pascal中两个不同的参数传递机制的需要 。"
108+ "对象具有个性,多个名称(在多个作用域内 )可以绑定到同一个对象。这在其他语言中称为别名。乍一看Python时通常不会理解这一点,在处理不可变的基本类型(数字,字符串,元组)时可以安全地忽略它。但是,别名对涉及可变对象,如列表, 字典和大多数其他类型,的Python代码的语义可能会产生惊人的影响。这通常用于程序的好处,因为别名在某些方面表现得像指针。例如,传递一个对象很便宜,因为实现只传递一个指针; 如果函数修改了作为参数传递的对象,调用者将看到更改"
109+ " --- 这就不需要像 Pascal 中那样使用两个不同的参数传递机制 。"
104110
105111#: ../../tutorial/classes.rst:61
106112msgid "Python Scopes and Namespaces"
@@ -766,7 +772,7 @@ msgid ""
766772"implementation detail and subject to change without notice."
767773msgstr ""
768774
769- #: ../../tutorial/classes.rst:675
775+ #: ../../tutorial/classes.rst:678
770776msgid ""
771777"Since there is a valid use-case for class-private members (namely to avoid "
772778"name clashes of names with names defined by subclasses), there is limited "
@@ -778,28 +784,28 @@ msgid ""
778784"identifier, as long as it occurs within the definition of a class."
779785msgstr ""
780786
781- #: ../../tutorial/classes.rst:684
787+ #: ../../tutorial/classes.rst:687
782788msgid ""
783789"Name mangling is helpful for letting subclasses override methods without "
784790"breaking intraclass method calls. For example::"
785791msgstr "名称修改有助于让子类重载方法而不破坏类内方法调用。例如::"
786792
787- #: ../../tutorial/classes.rst:706
793+ #: ../../tutorial/classes.rst:709
788794msgid ""
789795"The above example would work even if ``MappingSubclass`` were to introduce a"
790796" ``__update`` identifier since it is replaced with ``_Mapping__update`` in "
791797"the ``Mapping`` class and ``_MappingSubclass__update`` in the "
792798"``MappingSubclass`` class respectively."
793799msgstr ""
794800
795- #: ../../tutorial/classes.rst:711
801+ #: ../../tutorial/classes.rst:714
796802msgid ""
797803"Note that the mangling rules are designed mostly to avoid accidents; it "
798804"still is possible to access or modify a variable that is considered private."
799805" This can even be useful in special circumstances, such as in the debugger."
800806msgstr "请注意,修剪规则主要是为了避免事故;它仍然可以访问或修改被视为私有的变量。这在特殊情况下甚至可能很有用,例如在调试器中。"
801807
802- #: ../../tutorial/classes.rst:715
808+ #: ../../tutorial/classes.rst:718
803809msgid ""
804810"Notice that code passed to ``exec()`` or ``eval()`` does not consider the "
805811"classname of the invoking class to be the current class; this is similar to "
@@ -809,19 +815,19 @@ msgid ""
809815"referencing ``__dict__`` directly."
810816msgstr ""
811817
812- #: ../../tutorial/classes.rst:726
818+ #: ../../tutorial/classes.rst:729
813819msgid "Odds and Ends"
814820msgstr "其余琐碎"
815821
816- #: ../../tutorial/classes.rst:728
822+ #: ../../tutorial/classes.rst:731
817823msgid ""
818824"Sometimes it is useful to have a data type similar to the Pascal \" record\" "
819825"or C \" struct\" , bundling together a few named data items. An empty class "
820826"definition will do nicely::"
821827msgstr ""
822828"有时,使用类似于Pascal “record”或C “struct”的数据类型是有用的,将一些命名数据项捆绑在一起。定义一个空类就很适合::"
823829
824- #: ../../tutorial/classes.rst:742
830+ #: ../../tutorial/classes.rst:745
825831msgid ""
826832"A piece of Python code that expects a particular abstract data type can "
827833"often be passed a class that emulates the methods of that data type instead."
@@ -831,24 +837,24 @@ msgid ""
831837"it as an argument."
832838msgstr ""
833839
834- #: ../../tutorial/classes.rst:753
840+ #: ../../tutorial/classes.rst:756
835841msgid ""
836842"Instance method objects have attributes, too: ``m.__self__`` is the instance"
837843" object with the method :meth:`m`, and ``m.__func__`` is the function object"
838844" corresponding to the method."
839845msgstr ""
840846
841- #: ../../tutorial/classes.rst:761
847+ #: ../../tutorial/classes.rst:764
842848msgid "Iterators"
843849msgstr "迭代器"
844850
845- #: ../../tutorial/classes.rst:763
851+ #: ../../tutorial/classes.rst:766
846852msgid ""
847853"By now you have probably noticed that most container objects can be looped "
848854"over using a :keyword:`for` statement::"
849855msgstr "到目前为止,您可能已经注意到大多数容器对象都可以使用 :keyword:`for` 语句::"
850856
851- #: ../../tutorial/classes.rst:777
857+ #: ../../tutorial/classes.rst:780
852858msgid ""
853859"This style of access is clear, concise, and convenient. The use of "
854860"iterators pervades and unifies Python. Behind the scenes, the "
@@ -861,19 +867,19 @@ msgid ""
861867":func:`next` built-in function; this example shows how it all works::"
862868msgstr ""
863869
864- #: ../../tutorial/classes.rst:802
870+ #: ../../tutorial/classes.rst:805
865871msgid ""
866872"Having seen the mechanics behind the iterator protocol, it is easy to add "
867873"iterator behavior to your classes. Define an :meth:`__iter__` method which "
868874"returns an object with a :meth:`~iterator.__next__` method. If the class "
869875"defines :meth:`__next__`, then :meth:`__iter__` can just return ``self``::"
870876msgstr ""
871877
872- #: ../../tutorial/classes.rst:839
878+ #: ../../tutorial/classes.rst:842
873879msgid "Generators"
874880msgstr "生成器"
875881
876- #: ../../tutorial/classes.rst:841
882+ #: ../../tutorial/classes.rst:844
877883msgid ""
878884":term:`Generator`\\ s are a simple and powerful tool for creating iterators."
879885" They are written like regular functions but use the :keyword:`yield` "
@@ -883,35 +889,35 @@ msgid ""
883889"generators can be trivially easy to create::"
884890msgstr ""
885891
886- #: ../../tutorial/classes.rst:862
892+ #: ../../tutorial/classes.rst:865
887893msgid ""
888894"Anything that can be done with generators can also be done with class-based "
889895"iterators as described in the previous section. What makes generators so "
890896"compact is that the :meth:`__iter__` and :meth:`~generator.__next__` methods"
891897" are created automatically."
892898msgstr ""
893899
894- #: ../../tutorial/classes.rst:867
900+ #: ../../tutorial/classes.rst:870
895901msgid ""
896902"Another key feature is that the local variables and execution state are "
897903"automatically saved between calls. This made the function easier to write "
898904"and much more clear than an approach using instance variables like "
899905"``self.index`` and ``self.data``."
900906msgstr ""
901907
902- #: ../../tutorial/classes.rst:872
908+ #: ../../tutorial/classes.rst:875
903909msgid ""
904910"In addition to automatic method creation and saving program state, when "
905911"generators terminate, they automatically raise :exc:`StopIteration`. In "
906912"combination, these features make it easy to create iterators with no more "
907913"effort than writing a regular function."
908914msgstr ""
909915
910- #: ../../tutorial/classes.rst:881
916+ #: ../../tutorial/classes.rst:884
911917msgid "Generator Expressions"
912918msgstr "生成器表达式"
913919
914- #: ../../tutorial/classes.rst:883
920+ #: ../../tutorial/classes.rst:886
915921msgid ""
916922"Some simple generators can be coded succinctly as expressions using a syntax"
917923" similar to list comprehensions but with parentheses instead of square "
@@ -921,15 +927,15 @@ msgid ""
921927"more memory friendly than equivalent list comprehensions."
922928msgstr ""
923929
924- #: ../../tutorial/classes.rst:890
930+ #: ../../tutorial/classes.rst:893
925931msgid "Examples::"
926932msgstr "例如::"
927933
928- #: ../../tutorial/classes.rst:914
934+ #: ../../tutorial/classes.rst:917
929935msgid "Footnotes"
930936msgstr "脚注"
931937
932- #: ../../tutorial/classes.rst:915
938+ #: ../../tutorial/classes.rst:918
933939msgid ""
934940"Except for one thing. Module objects have a secret read-only attribute "
935941"called :attr:`~object.__dict__` which returns the dictionary used to "
0 commit comments