@@ -19,7 +19,7 @@ msgid ""
1919msgstr ""
2020"Project-Id-Version : Python 3.9\n "
2121"Report-Msgid-Bugs-To : \n "
22- "POT-Creation-Date : 2020-05-31 09:25 +0000\n "
22+ "POT-Creation-Date : 2020-07-29 03:44 +0000\n "
2323"PO-Revision-Date : 2017-02-16 17:44+0000\n "
2424"
Last-Translator :
WH-2099 <[email protected] >, 2020\n "
2525"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -393,17 +393,17 @@ msgid ""
393393"practice::"
394394msgstr "运行解释器显示了函数描述器在实践中的工作方式:"
395395
396- #: ../../howto/descriptor.rst:326
396+ #: ../../howto/descriptor.rst:324
397397msgid "Static Methods and Class Methods"
398398msgstr "静态方法和类方法"
399399
400- #: ../../howto/descriptor.rst:328
400+ #: ../../howto/descriptor.rst:326
401401msgid ""
402402"Non-data descriptors provide a simple mechanism for variations on the usual "
403403"patterns of binding functions into methods."
404404msgstr "非数据描述器为把函数绑定为方法的通常模式提供了一种简单的机制。"
405405
406- #: ../../howto/descriptor.rst:331
406+ #: ../../howto/descriptor.rst:329
407407msgid ""
408408"To recap, functions have a :meth:`__get__` method so that they can be "
409409"converted to a method when accessed as attributes. The non-data descriptor "
@@ -413,52 +413,52 @@ msgstr ""
413413"概括地说,函数具有 :meth:`__get__` 方法,以便在作为属性访问时可以将其转换为方法。非数据描述符将 ``obj.f(*args)`` "
414414"的调用转换为 ``f(obj, *args)`` 。调用 `klass.f(*args)`` 因而变成 ``f(*args)`` 。"
415415
416- #: ../../howto/descriptor.rst:336
416+ #: ../../howto/descriptor.rst:334
417417msgid "This chart summarizes the binding and its two most useful variants:"
418418msgstr "下表总结了绑定及其两个最有用的变体:"
419419
420- #: ../../howto/descriptor.rst:339
420+ #: ../../howto/descriptor.rst:337
421421msgid "Transformation"
422422msgstr "转换形式"
423423
424- #: ../../howto/descriptor.rst:339
424+ #: ../../howto/descriptor.rst:337
425425msgid "Called from an Object"
426426msgstr "通过对象调用"
427427
428- #: ../../howto/descriptor.rst:339
428+ #: ../../howto/descriptor.rst:337
429429msgid "Called from a Class"
430430msgstr "通过类调用"
431431
432- #: ../../howto/descriptor.rst:342
432+ #: ../../howto/descriptor.rst:340
433433msgid "function"
434434msgstr "函数"
435435
436- #: ../../howto/descriptor.rst:342
436+ #: ../../howto/descriptor.rst:340
437437msgid "f(obj, \\ *args)"
438438msgstr "f(obj, \\ *args)"
439439
440- #: ../../howto/descriptor.rst:342 ../../howto/descriptor.rst:344
441- #: ../../howto/descriptor.rst:344
440+ #: ../../howto/descriptor.rst:340 ../../howto/descriptor.rst:342
441+ #: ../../howto/descriptor.rst:342
442442msgid "f(\\ *args)"
443443msgstr "f(\\ *args)"
444444
445- #: ../../howto/descriptor.rst:344
445+ #: ../../howto/descriptor.rst:342
446446msgid "staticmethod"
447447msgstr "静态方法"
448448
449- #: ../../howto/descriptor.rst:346
449+ #: ../../howto/descriptor.rst:344
450450msgid "classmethod"
451451msgstr "类方法"
452452
453- #: ../../howto/descriptor.rst:346
453+ #: ../../howto/descriptor.rst:344
454454msgid "f(type(obj), \\ *args)"
455455msgstr "f(type(obj), \\ *args)"
456456
457- #: ../../howto/descriptor.rst:346
457+ #: ../../howto/descriptor.rst:344
458458msgid "f(klass, \\ *args)"
459459msgstr "f(klass, \\ *args)"
460460
461- #: ../../howto/descriptor.rst:349
461+ #: ../../howto/descriptor.rst:347
462462msgid ""
463463"Static methods return the underlying function without changes. Calling "
464464"either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into "
@@ -469,13 +469,13 @@ msgstr ""
469469"静态方法返回底层函数,不做任何更改。调用 ``c.f`` 或 ``C.f`` 等效于通过 ``object.__getattribute__(c, "
470470"\" f\" )`` 或 ``object.__getattribute__(C, \" f\" )`` 查找。这样该函数就可以从对象或类中进行相同的访问。"
471471
472- #: ../../howto/descriptor.rst:355
472+ #: ../../howto/descriptor.rst:353
473473msgid ""
474474"Good candidates for static methods are methods that do not reference the "
475475"``self`` variable."
476476msgstr "适合于作为静态方法的是那些不引用 ``self`` 变量的方法。"
477477
478- #: ../../howto/descriptor.rst:358
478+ #: ../../howto/descriptor.rst:356
479479msgid ""
480480"For instance, a statistics package may include a container class for "
481481"experimental data. The class provides normal methods for computing the "
@@ -490,26 +490,26 @@ msgstr ""
490490" ``erf(x)`` 是在统计中的便捷转换,但并不直接依赖于特定的数据集。可以从对象或类中调用它: ``s.erf(1.5) --> .9332`` "
491491"或 ``Sample.erf(1.5) --> .9332``。"
492492
493- #: ../../howto/descriptor.rst:367
493+ #: ../../howto/descriptor.rst:365
494494msgid ""
495495"Since staticmethods return the underlying function with no changes, the "
496496"example calls are unexciting::"
497497msgstr "由于静态方法直接返回了底层的函数,因此示例调用是相同的:"
498498
499- #: ../../howto/descriptor.rst:380
499+ #: ../../howto/descriptor.rst:378
500500msgid ""
501501"Using the non-data descriptor protocol, a pure Python version of "
502502":func:`staticmethod` would look like this::"
503503msgstr "使用非数据描述器,纯 Python 版本的 :func:`staticmethod` 如下所示:"
504504
505- #: ../../howto/descriptor.rst:392
505+ #: ../../howto/descriptor.rst:390
506506msgid ""
507507"Unlike static methods, class methods prepend the class reference to the "
508508"argument list before calling the function. This format is the same for "
509509"whether the caller is an object or a class::"
510510msgstr "与静态方法不同,类方法在调用函数之前将类引用放在参数列表的最前。无论调用方是对象还是类,此格式相同:"
511511
512- #: ../../howto/descriptor.rst:407
512+ #: ../../howto/descriptor.rst:405
513513msgid ""
514514"This behavior is useful whenever the function only needs to have a class "
515515"reference and does not care about any underlying data. One use for "
@@ -520,11 +520,11 @@ msgstr ""
520520"当函数仅需要使用类引用并且不关心任何底层数据时,此行为就很有用。类方法的一种用途是创建替代的类构造函数。在 Python 2.3 中,类方法 "
521521":func:`dict.fromkeys` 从键列表创建一个新的字典。纯 Python 等价实现是::"
522522
523- #: ../../howto/descriptor.rst:423
523+ #: ../../howto/descriptor.rst:421
524524msgid "Now a new dictionary of unique keys can be constructed like this::"
525525msgstr "现在可以这样构造一个新的唯一键字典:"
526526
527- #: ../../howto/descriptor.rst:428
527+ #: ../../howto/descriptor.rst:426
528528msgid ""
529529"Using the non-data descriptor protocol, a pure Python version of "
530530":func:`classmethod` would look like this::"
0 commit comments