Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a5fd4d5

Browse files
[po] auto sync
1 parent de099b4 commit a5fd4d5

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "90.24%", "updated_at": "2023-08-30T23:56:48Z"}
1+
{"translation": "90.26%", "updated_at": "2023-08-31T06:56:32Z"}

tutorial/classes.po

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,8 @@ msgid ""
477477
"greater flexibility. In that case, arguments given to the class "
478478
"instantiation operator are passed on to :meth:`!__init__`. For example, ::"
479479
msgstr ""
480+
"当然,:meth:`~object.__init__` 方法还有一些参数用于实现更高的灵活性。 在这种情况下,提供给类实例化运算符的参数将被传递给 "
481+
":meth:`!__init__`。 例如, ::"
480482

481483
#: ../../tutorial/classes.rst:322
482484
msgid "Instance Objects"
@@ -498,6 +500,9 @@ msgid ""
498500
"following piece of code will print the value ``16``, without leaving a "
499501
"trace::"
500502
msgstr ""
503+
"*数据属性* 对应于 Smalltalk 中的“实例变量”,以及 C++ 中的“数据成员”。 "
504+
"数据属性不需要声明;就像局部变量一样,它们将在首次被赋值时产生。 举例来说,如果 ``x`` 是上面创建的 :class:`!MyClass` "
505+
"的实例,则以下代码将打印数值 ``16``,且不保留任何追踪信息::"
501506

502507
#: ../../tutorial/classes.rst:340
503508
msgid ""
@@ -541,6 +546,8 @@ msgid ""
541546
"is a method object, and can be stored away and called at a later time. For "
542547
"example::"
543548
msgstr ""
549+
"在 :class:`!MyClass` 示例中,这将返回字符串 ``'hello world'``。 但是,方法并不是必须立即调用: ``x.f`` "
550+
"是一个方法对象,它可以被保存起来以后再调用。 例如::"
544551

545552
#: ../../tutorial/classes.rst:374
546553
msgid "will continue to print ``hello world`` until the end of time."
@@ -555,6 +562,9 @@ msgid ""
555562
" argument is called without any --- even if the argument isn't actually "
556563
"used..."
557564
msgstr ""
565+
"当一个方法被调用时究竟会发生什么? 你可能已经注意到尽管 :meth:`!f` 的函数定义指定了一个参数,但上面调用 ``x.f()`` "
566+
"时却没有带参数。 这个参数发生了什么事? 当一个需要参数的函数在不附带任何参数的情况下被调用时 Python 肯定会引发异常 --- "
567+
"即使参数实际上没有被使用..."
558568

559569
#: ../../tutorial/classes.rst:382
560570
msgid ""
@@ -684,6 +694,8 @@ msgid ""
684694
"instances of :class:`!C` --- ``h`` being exactly equivalent to ``g``. Note "
685695
"that this practice usually only serves to confuse the reader of a program."
686696
msgstr ""
697+
"现在 ``f``、``g`` 和 ``h`` 都 :class:`!C` 类的指向函数对象的属性,因此它们都是 :class:`!C` 实例的方法 "
698+
"--- 其中 ``h`` 与 ``g`` 完全等价。 但请注意这种做法通常只会使程序的阅读者感到迷惑。"
687699

688700
#: ../../tutorial/classes.rst:540
689701
msgid ""
@@ -729,6 +741,8 @@ msgid ""
729741
"class name, other arbitrary expressions are also allowed. This can be "
730742
"useful, for example, when the base class is defined in another module::"
731743
msgstr ""
744+
"名称 :class:`!BaseClassName` 必须定义于可从包含所派生的类的定义的作用域访问的命名空间中。 "
745+
"作为基类名称的替代,也允许使用其他任意表达式。 例如,当基类定义在另一个模块中时,这就会很有用处::"
732746

733747
#: ../../tutorial/classes.rst:592
734748
msgid ""
@@ -822,6 +836,9 @@ msgid ""
822836
"classes of :class:`!Base1`, and if it was not found there, it was searched "
823837
"for in :class:`!Base2`, and so on."
824838
msgstr ""
839+
"对于多数目的来说,在最简单的情况下,你可以认为搜索从父类所继承属性的操作是深度优先、从左到右的,当层次结构存在重叠时不会在同一个类中搜索两次。 "
840+
"因此,如果某个属性在 :class:`!DerivedClassName` 中找不到,就会在 :class:`!Base1` 中搜索它,然后(递归地)在"
841+
" :class:`!Base1` 的基类中搜索,如果在那里也找不到,就将在 :class:`!Base2` 中搜索,依此类推。"
825842

826843
#: ../../tutorial/classes.rst:652
827844
msgid ""
@@ -948,6 +965,9 @@ msgid ""
948965
":meth:`~io.TextIOBase.readline` that get the data from a string buffer "
949966
"instead, and pass it as an argument."
950967
msgstr ""
968+
"一段期望使用特定抽象数据类型的 Python 代码通常可以通过传入一个模拟了该数据类型的方法的类作为替代。 "
969+
"例如,如果你有一个基于文件对象来格式化某些数据的函数,你可以定义一个带有 :meth:`~io.TextIOBase.read` 和 "
970+
":meth:`~io.TextIOBase.readline` 方法以便从字典串缓冲区获取数据的类,并将其作为参数传入。"
951971

952972
#: ../../tutorial/classes.rst:772
953973
msgid ""

0 commit comments

Comments
 (0)