13131414# Siyuan Xu <[email protected] >, 20201515# jaystone776 <[email protected] >, 202016- # Freesand Leo <[email protected] >, 2020 16+ # Freesand Leo <[email protected] >, 2021 1717#
1818#, fuzzy
1919msgid ""
@@ -22,7 +22,7 @@ msgstr ""
2222"Report-Msgid-Bugs-To : \n "
2323"POT-Creation-Date : 2020-04-10 22:51+0000\n "
2424"PO-Revision-Date : 2019-09-01 03:30+0000\n "
25- "
Last-Translator :
Freesand Leo <[email protected] >, 2020 \n "
25+ "
Last-Translator :
Freesand Leo <[email protected] >, 2021 \n "
2626"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2727"MIME-Version : 1.0\n "
2828"Content-Type : text/plain; charset=UTF-8\n "
@@ -489,19 +489,19 @@ msgstr ":class:`collections.abc.Reversible` 的泛型版本。"
489489
490490#: ../../library/typing.rst:518
491491msgid "An ABC with one abstract method ``__int__``."
492- msgstr ""
492+ msgstr "含抽象方法 ``__int__`` 的抽象基类。 "
493493
494494#: ../../library/typing.rst:522
495495msgid "An ABC with one abstract method ``__float__``."
496- msgstr ""
496+ msgstr "含抽象方法 ``__float__`` 的抽象基类。 "
497497
498498#: ../../library/typing.rst:526
499499msgid "An ABC with one abstract method ``__complex__``."
500- msgstr ""
500+ msgstr "含抽象方法 ``__complex__`` 的抽象基类。 "
501501
502502#: ../../library/typing.rst:530
503503msgid "An ABC with one abstract method ``__bytes__``."
504- msgstr ""
504+ msgstr "含抽象方法 ``__bytes__`` 的抽象基类(ABC) "
505505
506506#: ../../library/typing.rst:534
507507msgid ""
@@ -513,7 +513,7 @@ msgstr "含抽象方法 ``__abs__`` 的抽象基类(ABC)是其返回类型
513513msgid ""
514514"An ABC with one abstract method ``__round__`` that is covariant in its "
515515"return type."
516- msgstr ""
516+ msgstr "含抽象方法 ``__round__`` 的抽象基类,是其返回类型的协变量。 "
517517
518518#: ../../library/typing.rst:544
519519msgid "A generic version of :class:`collections.abc.Container`."
@@ -629,6 +629,8 @@ msgid ""
629629"order of type variables correspond to those of :class:`Generator`, for "
630630"example::"
631631msgstr ""
632+ ":class:`collections.abc.Coroutine` 的泛型版本。类型变量的的差异和顺序与 :class:`Generator` "
633+ "的内容相对应,例如:"
632634
633635#: ../../library/typing.rst:671
634636msgid "A generic version of :class:`collections.abc.AsyncIterable`."
@@ -679,50 +681,54 @@ msgstr ":class:`collections.ChainMap` 的泛型版本。"
679681msgid ""
680682"A generator can be annotated by the generic type ``Generator[YieldType, "
681683"SendType, ReturnType]``. For example::"
682- msgstr ""
684+ msgstr "生成器可以由泛型类型 ``Generator[YieldType, SendType, ReturnType]`` 注解。例如: "
683685
684686#: ../../library/typing.rst:743
685687msgid ""
686688"Note that unlike many other generics in the typing module, the ``SendType`` "
687689"of :class:`Generator` behaves contravariantly, not covariantly or "
688690"invariantly."
689691msgstr ""
692+ "注意,与 typing 模块里的其他泛型不同, :class:`Generator` 的``SendType`` 的操作是逆变的, 不是协变,也是不变。"
690693
691694#: ../../library/typing.rst:747
692695msgid ""
693696"If your generator will only yield values, set the ``SendType`` and "
694697"``ReturnType`` to ``None``::"
695- msgstr ""
698+ msgstr "如果生成器只生成值,可将 ``SendType`` 与 ``ReturnType`` 设为 ``None``: "
696699
697700#: ../../library/typing.rst:755
698701msgid ""
699702"Alternatively, annotate your generator as having a return type of either "
700703"``Iterable[YieldType]`` or ``Iterator[YieldType]``::"
701- msgstr ""
704+ msgstr "另外,把生成器注解为返回类型 "
702705
703706#: ../../library/typing.rst:765
704707msgid ""
705708"An async generator can be annotated by the generic type "
706709"``AsyncGenerator[YieldType, SendType]``. For example::"
707- msgstr ""
710+ msgstr "异步生成器可由泛型类型 ``AsyncGenerator[YieldType, SendType]`` 注解。例如: "
708711
709712#: ../../library/typing.rst:774
710713msgid ""
711714"Unlike normal generators, async generators cannot return a value, so there "
712715"is no ``ReturnType`` type parameter. As with :class:`Generator`, the "
713716"``SendType`` behaves contravariantly."
714717msgstr ""
718+ "与常规生成器不同,异步生成器不能返回值,因此没有 ``ReturnType`` 类型参数。 与 :class:`Generator` "
719+ "类似,``SendType`` 也属于逆变行为。"
715720
716721#: ../../library/typing.rst:778
717722msgid ""
718723"If your generator will only yield values, set the ``SendType`` to ``None``::"
719- msgstr ""
724+ msgstr "如果生成器只产生值,可将 ``SendType`` 设置为 ``None``: "
720725
721726#: ../../library/typing.rst:786
722727msgid ""
723728"Alternatively, annotate your generator as having a return type of either "
724729"``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::"
725730msgstr ""
731+ "此外,可用 ``AsyncIterable[YieldType]`` 或 ``AsyncIterator[YieldType]`` 注解生成器的类型:"
726732
727733#: ../../library/typing.rst:798
728734msgid ""
@@ -815,14 +821,14 @@ msgstr ""
815821
816822#: ../../library/typing.rst:899
817823msgid "Cast a value to a type."
818- msgstr ""
824+ msgstr "把值强制转换为类型。 "
819825
820826#: ../../library/typing.rst:901
821827msgid ""
822828"This returns the value unchanged. To the type checker this signals that the"
823829" return value has the designated type, but at runtime we intentionally don't"
824830" check anything (we want this to be as fast as possible)."
825- msgstr ""
831+ msgstr "不变更返回值。对类型检查器来说,这代表了返回值具有指定的类型,但在运行时,故意不做任何检查(目的是让该检查速度尽量快)。 "
826832
827833#: ../../library/typing.rst:908
828834msgid ""
@@ -854,10 +860,14 @@ msgid ""
854860"gives a more precise type than can be expressed using a union or a type "
855861"variable::"
856862msgstr ""
863+ "``@overload`` 装饰器可以修饰支持多个不同参数类型组合的函数或方法。``@overload`` - 装饰定义的系列必须紧跟一个非 "
864+ "``@overload``-装饰定义(用于同一个函数/方法)。``@overload``-装饰定义仅是为了协助类型检查器, 因为该装饰器会被非 "
865+ "``@overload``-装饰定义覆盖,后者用于运行时,而且会被类型检查器忽略。在运行时直接调用 ``@overload`` 装饰的函数会触发 "
866+ ":exc:`NotImplementedError`。下面的重载示例给出了比联合类型或类型变量更精准的类型:"
857867
858868#: ../../library/typing.rst:945
859869msgid "See :pep:`484` for details and comparison with other typing semantics."
860- msgstr ""
870+ msgstr "详见 :pep:`484`,与其他类型语义进行对比。 "
861871
862872#: ../../library/typing.rst:949
863873msgid "Decorator to indicate that annotations are not type hints."
@@ -895,13 +905,13 @@ msgid ""
895905"This decorator is itself not available at runtime. It is mainly intended to "
896906"mark classes that are defined in type stub files if an implementation "
897907"returns an instance of a private class::"
898- msgstr ""
908+ msgstr "在运行时,该装饰器本身不可用。实现返回了私有类实例时,它主要是用于标记在类型存根文件中定义的类。 "
899909
900910#: ../../library/typing.rst:979
901911msgid ""
902912"Note that returning instances of private classes is not recommended. It is "
903913"usually preferable to make such classes public."
904- msgstr ""
914+ msgstr "注意,不建议返回私有类的实例,最好将这些类设为公共类。 "
905915
906916#: ../../library/typing.rst:984
907917msgid "Special type indicating an unconstrained type."
@@ -1080,7 +1090,7 @@ msgstr "这里指的是,它可以接受任意同类字符串,但不支持混
10801090msgid ""
10811091"A special constant that is assumed to be ``True`` by 3rd party static type "
10821092"checkers. It is ``False`` at runtime. Usage::"
1083- msgstr ""
1093+ msgstr "被第三方静态类型检查器假定为 ``True`` 的特殊常量。 在运行时为 ``False``。 用法如下:: "
10841094
10851095#: ../../library/typing.rst:1139
10861096msgid ""
0 commit comments