@@ -429,13 +429,16 @@ msgid ""
429429"assignment. :attr:`__doc__` is also a valid attribute, returning the "
430430"docstring belonging to the class: ``\" A simple example class\" ``."
431431msgstr ""
432+ "那么 ``MyClass.i`` 和 ``MyClass.f`` 就是有效的属性引用,将分别返回一个整数和一个函数对象。 "
433+ "类属性也可以被赋值,因此可以通过赋值来更改 ``MyClass.i`` 的值。 :attr:`__doc__` "
434+ "也是一个有效的属性,将返回所属类的文档字符串: ``\" A simple example class\" ``。"
432435
433436#: ../../tutorial/classes.rst:282
434437msgid ""
435438"Class *instantiation* uses function notation. Just pretend that the class "
436439"object is a parameterless function that returns a new instance of the class."
437440" For example (assuming the above class)::"
438- msgstr ""
441+ msgstr "类的 *实例化* 是使用函数表示法。 可以相像类对象就是会返回一个新的类实例的不带参数的函数。 举例来说(假设使用上述的类):: "
439442
440443#: ../../tutorial/classes.rst:288
441444msgid ""
@@ -450,20 +453,26 @@ msgid ""
450453"specific initial state. Therefore a class may define a special method named "
451454":meth:`__init__`, like this::"
452455msgstr ""
456+ "实例化操作(“调用”类对象)会创建一个空对象。 许多类喜欢创建带有特定初始状态的自定义实例。 为此类定义可能包含一个名为 "
457+ ":meth:`__init__` 的特殊方法,就像这样::"
453458
454459#: ../../tutorial/classes.rst:299
455460msgid ""
456461"When a class defines an :meth:`__init__` method, class instantiation "
457462"automatically invokes :meth:`__init__` for the newly-created class instance."
458463" So in this example, a new, initialized instance can be obtained by::"
459464msgstr ""
465+ "当一个类定义了 :meth:`__init__` 方法时,类的实例化操作会自动为新创建的类实例发起调用 :meth:`__init__`。 "
466+ "因此在这个示例中,可以通过以下语句获得一个经初始化的新实例::"
460467
461468#: ../../tutorial/classes.rst:305
462469msgid ""
463470"Of course, the :meth:`__init__` method may have arguments for greater "
464471"flexibility. In that case, arguments given to the class instantiation "
465472"operator are passed on to :meth:`__init__`. For example, ::"
466473msgstr ""
474+ "当然,:meth:`__init__` 方法还可以有额外参数以实现更高灵活性。 在这种情况下,提供给类实例化运算符的参数将被传递给 "
475+ ":meth:`__init__`。 例如,::"
467476
468477#: ../../tutorial/classes.rst:322
469478msgid "Instance Objects"
0 commit comments