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

Skip to content

Commit 20beb5b

Browse files
committed
[po] auto sync bot
1 parent a03a9a4 commit 20beb5b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tutorial/classes.po

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,8 @@ msgid ""
540540
"is a method object, and can be stored away and called at a later time. For "
541541
"example::"
542542
msgstr ""
543+
"在 :class:`MyClass` 示例中,这将返回字符串 ``'hello world'``。 但是,立即调用一个方法并不是必须的: ``x.f``"
544+
" 是一个方法对象,它可以被保存起来以后再调用。 例如::"
543545

544546
#: ../../tutorial/classes.rst:374
545547
msgid "will continue to print ``hello world`` until the end of time."
@@ -554,6 +556,8 @@ msgid ""
554556
" argument is called without any --- even if the argument isn't actually "
555557
"used..."
556558
msgstr ""
559+
"当一个方法被调用时到底发生了什么? 你可能已经注意到上面调用 ``x.f()`` 时并没有带参数,虽然 :meth:`f` 的函数定义指定了一个参数。 "
560+
"这个参数发生了什么事? 当不带参数地调用一个需要参数的函数时 Python 肯定会引发异常 --- 即使参数实际未被使用..."
557561

558562
#: ../../tutorial/classes.rst:382
559563
msgid ""
@@ -565,6 +569,9 @@ msgid ""
565569
"that is created by inserting the method's instance object before the first "
566570
"argument."
567571
msgstr ""
572+
"实际上,你可能已经猜到了答案:方法的特殊之处就在于实例对象会作为函数的第一个参数被传入。 在我们的示例中,调用 ``x.f()`` 其实就相当于 "
573+
"``MyClass.f(x)``。 总之,调用一个具有 *n* "
574+
"个参数的方法就相当于调用再多一个参数的对应函数,这个参数值为方法所属实例对象,位置在其他参数之前。"
568575

569576
#: ../../tutorial/classes.rst:389
570577
msgid ""
@@ -578,6 +585,9 @@ msgid ""
578585
"from the instance object and the argument list, and the function object is "
579586
"called with this new argument list."
580587
msgstr ""
588+
"如果你仍然无法理解方法的运作原理,那么查看实现细节可能会澄清问题。 当一个实例的非数据属性被引用时,将搜索实例所属的类。 "
589+
"如果名称表示一个属于函数对象的有效类属性,会通过合并打包(指向)实例对象和函数对象到一个抽象对象中的方式来创建一个方法对象:这个抽象对象就是方法对象。 "
590+
"当附带参数列表调用方法对象时,将基于实例对象和参数列表构建一个新的参数列表,并使用这个新参数列表调用相应的函数对象。"
581591

582592
#: ../../tutorial/classes.rst:403
583593
msgid "Class and Instance Variables"

0 commit comments

Comments
 (0)