File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -865,6 +865,8 @@ msgid ""
865865"itself, so that calling either ``x.f(1)`` or ``C.f(1)`` is equivalent to "
866866"calling ``f(C,1)`` where ``f`` is the underlying function."
867867msgstr ""
868+ "当一个实例方法对象是衍生自一个类方法对象时,保存在 :attr:`__self__` 中的 \" 类实例\" 实际上会是该类本身,因此无论是调用 "
869+ "``x.f(1)`` 还是 ``C.f(1)`` 都等同于调用 ``f(C,1)``,其中 ``f`` 为对应的下层函数。"
868870
869871#: ../../reference/datamodel.rst:600
870872msgid ""
@@ -878,10 +880,13 @@ msgid ""
878880"class instance are not converted to bound methods; this *only* happens when "
879881"the function is an attribute of the class."
880882msgstr ""
883+ "请注意从函数对象到实例方法对象的变换会在每一次从实例获取属性时发生。在某些情况下,一种高效的优化方式是将属性赋值给一个本地变量并调用该本地变量。还要注意这样的变换只发生于用户定义函数;其他可调用对象"
884+ " (以及所有不可调用对象) 在被获取时都不会发生变换。还有一个需要关注的要点是作为一个类实例属性的用户定义函数不会被转换为绑定方法;这样的变换 *仅当*"
885+ " 函数是类属性时才会发生。"
881886
882887#: ../../reference/datamodel.rst:624
883888msgid "Generator functions"
884- msgstr ""
889+ msgstr "生成器函数 "
885890
886891#: ../../reference/datamodel.rst:616
887892msgid ""
You can’t perform that action at this time.
0 commit comments