1111# ChenYuan <[email protected] >, 20191212# Siyuan Xu <[email protected] >, 20191313# Meng Du <[email protected] >, 201914- # ppcfish <[email protected] >, 20191514# Freesand Leo <[email protected] >, 201915+ # ppcfish <[email protected] >, 20191616#
1717#, fuzzy
1818msgid ""
@@ -21,7 +21,7 @@ msgstr ""
2121"Report-Msgid-Bugs-To : \n "
2222"POT-Creation-Date : 2019-05-14 11:26+0900\n "
2323"PO-Revision-Date : 2017-02-16 17:43+0000\n "
24- "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2019\n "
24+ "Last-Translator : ppcfish <ppcfish@gmail .com>, 2019\n "
2525"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2626"MIME-Version : 1.0\n "
2727"Content-Type : text/plain; charset=UTF-8\n "
@@ -1757,13 +1757,15 @@ msgid ""
17571757"implementation of the method you're interested in changing and delegates all"
17581758" other methods to the corresponding method of ``x``."
17591759msgstr ""
1760+ "代理是一种面向对象的技术(也称为设计模式)。假设您有一个对象 ``x`` "
1761+ "并且想要改变其中一个方法的行为。您可以创建一个新类,它提供您感兴趣的方法的新实现,并将所有其他方法委托给 ``x`` 的相应方法。"
17601762
17611763#: ../../faq/programming.rst:1487
17621764msgid ""
17631765"Python programmers can easily implement delegation. For example, the "
17641766"following class implements a class that behaves like a file but converts all"
17651767" written data to uppercase::"
1766- msgstr ""
1768+ msgstr "Python程序员可以轻松实现代理。例如,以下类实现了一个类,该类的行为类似于文件,但将所有写入的数据转换为大写: "
17671769
17681770#: ../../faq/programming.rst:1502
17691771msgid ""
@@ -1798,7 +1800,7 @@ msgstr "如何从覆盖基类的派生类调用基类中定义的方法?"
17981800
17991801#: ../../faq/programming.rst:1527
18001802msgid "Use the built-in :func:`super` function::"
1801- msgstr ""
1803+ msgstr "使用内置的 :func:`super` 函数: "
18021804
18031805#: ../../faq/programming.rst:1533
18041806msgid ""
@@ -1808,6 +1810,9 @@ msgid ""
18081810"``Base.meth(self, arguments...)``. Here, ``Base.meth`` is an unbound "
18091811"method, so you need to provide the ``self`` argument."
18101812msgstr ""
1813+ "对于 Python 3.0之前的版本,您可能正在使用经典类:对于诸如 ``class Derived(Base): ...`` 之类的类定义,可以将在 "
1814+ "``Base`` (或 ``Base`` 中的一个的基类)中定义的方法 ``meth()`` 调用为 ``Base.meth(self, "
1815+ "arguments...)`` 。这里, ``Base.meth`` 是一个未绑定的方法,因此您需要提供 ``self`` 参数。"
18111816
18121817#: ../../faq/programming.rst:1541
18131818msgid "How can I organize my code to make it easier to change the base class?"
@@ -1822,6 +1827,7 @@ msgid ""
18221827"(e.g. depending on availability of resources) which base class to use. "
18231828"Example::"
18241829msgstr ""
1830+ "可以为基类定义别名,在类定义之前为其分配实际基类,并在整个类中使用别名。然后更改的是分配给别名的值,就能实现上述要求。顺便提一下,如果你想动态决定(例如,取决于资源的可用性)要使用哪个基类,这个技巧也很方便。例如:"
18251831
18261832#: ../../faq/programming.rst:1558
18271833msgid "How do I create static class data and static class methods?"
0 commit comments