1616# emrich <[email protected] >, 20211717# Shengjing Zhu <[email protected] >, 20211818# Arisaka97 <[email protected] >, 202119- # Freesand Leo <[email protected] >, 20212019# Pandaaaa906 <[email protected] >, 20212120# ppcfish <[email protected] >, 20212221# belingud <[email protected] >, 20212322# jaystone776 <[email protected] >, 20212423# Sean Chao <[email protected] >, 20212524# CCXXXI <[email protected] >, 202125+ # Dai Xu <[email protected] >, 202126+ # Freesand Leo <[email protected] >, 20212627#
2728#, fuzzy
2829msgid ""
@@ -31,7 +32,7 @@ msgstr ""
3132"Report-Msgid-Bugs-To : \n "
3233"POT-Creation-Date : 2021-07-29 13:22+0000\n "
3334"PO-Revision-Date : 2021-06-28 01:13+0000\n "
34- "Last-Translator : CCXXXI <ccxxxi@qq .com>, 2021\n "
35+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2021\n "
3536"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
3637"MIME-Version : 1.0\n "
3738"Content-Type : text/plain; charset=UTF-8\n "
@@ -5706,23 +5707,29 @@ msgid ""
57065707"Type Annotation Types --- :ref:`Generic Alias <types-genericalias>`, "
57075708":ref:`Union <types-union>`"
57085709msgstr ""
5710+ "类型注解的类型 --- :ref:`Generic Alias <types-genericalias>` 、 :ref:`Union <types-"
5711+ "union>`"
57095712
57105713#: ../../library/stdtypes.rst:4774
57115714msgid ""
57125715"The core built-in types for :term:`type annotations <annotation>` are "
57135716":ref:`Generic Alias <types-genericalias>` and :ref:`Union <types-union>`."
57145717msgstr ""
5718+ ":term:`type annotations <annotation>` 的内置类型为 :ref:`Generic Alias<types-"
5719+ "genericalias>` 和 :ref:`Union<types-union>`。"
57155720
57165721#: ../../library/stdtypes.rst:4781
57175722msgid "Generic Alias Type"
5718- msgstr ""
5723+ msgstr "GenericAlias 类型 "
57195724
57205725#: ../../library/stdtypes.rst:4787
57215726msgid ""
57225727"``GenericAlias`` objects are created by subscripting a class (usually a "
57235728"container), such as ``list[int]``. They are intended primarily for "
57245729":term:`type annotations <annotation>`."
57255730msgstr ""
5731+ "``GenericAlias`` 对象是通过对类(通常是容器类)作下标来创建的,如 ``list[int]`` 。主要用于 :term:`type "
5732+ "annotations <annotation>`。"
57265733
57275734#: ../../library/stdtypes.rst:4791
57285735msgid ""
@@ -5732,34 +5739,45 @@ msgid ""
57325739"of the class instead. The classmethod :meth:`__class_getitem__` should "
57335740"return a ``GenericAlias`` object."
57345741msgstr ""
5742+ "通常,容器对象的 :ref:`抽取 <subscriptions>` 操作会调用该对象的 :meth:`__getitem__` 方法。 "
5743+ "但是,对某些容器类执行抽取操作可能会改去调用该类的 :meth:`__class_getitem__` 类方法。 "
5744+ ":meth:`__class_getitem__` 类方法应当会返回一个 ``GenericAlias`` 对象。"
57355745
57365746#: ../../library/stdtypes.rst:4798
57375747msgid ""
57385748"If the :meth:`__getitem__` of the class' metaclass is present, it will take "
57395749"precedence over the :meth:`__class_getitem__` defined in the class (see "
57405750":pep:`560` for more details)."
57415751msgstr ""
5752+ "如果元类的 :meth:`__getitem__` 存在,将优先于类定义的 :meth:`__class_getitem__`(详见 "
5753+ ":pep:`560`)。"
57425754
57435755#: ../../library/stdtypes.rst:4802
57445756msgid ""
57455757"The ``GenericAlias`` object acts as a proxy for :term:`generic types "
57465758"<generic type>`, implementing *parameterized generics* - a specific instance"
57475759" of a generic which provides the types for container elements."
57485760msgstr ""
5761+ "``GenericAlias`` 对象作为 :term:`泛型类型 <generic type>` 的代理,具体实现 *形参化的泛型* —— "
5762+ "一个泛型的具体实例,为容器元素提供类型。"
57495763
57505764#: ../../library/stdtypes.rst:4806
57515765msgid ""
57525766"The user-exposed type for the ``GenericAlias`` object can be accessed from "
57535767":class:`types.GenericAlias` and used for :func:`isinstance` checks. It can "
57545768"also be used to create ``GenericAlias`` objects directly."
57555769msgstr ""
5770+ "用户通过 ``GenericAlias`` 对象暴露的类型可由 :class:`types.GenericAlias` 访问,并用于 "
5771+ ":func:`isinstance` 检查。也可用来直接创建 ``GenericAlias`` 对象。"
57565772
57575773#: ../../library/stdtypes.rst:4812
57585774msgid ""
57595775"Creates a ``GenericAlias`` representing a type ``T`` containing elements of "
57605776"types *X*, *Y*, and more depending on the ``T`` used. For example, a "
57615777"function expecting a :class:`list` containing :class:`float` elements::"
57625778msgstr ""
5779+ "创建代表类型 ``T`` 的 ``GenericAlias`` ,包含 *X* 、*Y* 等类型的元素,元素类型更多取决于所用的 "
5780+ "``T``。比如某函数需要包含 :class:`float` 元素的 :class:`list` :"
57635781
57645782#: ../../library/stdtypes.rst:4820
57655783msgid ""
@@ -5768,12 +5786,16 @@ msgid ""
57685786"the value type. In this example, the function expects a ``dict`` with keys "
57695787"of type :class:`str` and values of type :class:`int`::"
57705788msgstr ""
5789+ "另一个例子是关于 :term:`mapping` 对象的,用到了 "
5790+ ":class:`dict`,泛型的两个类型参数分别代表了键类型和值类型。本例中的函数需要一个 ``dict``,其键的类型为 "
5791+ ":class:`str`,值的类型为 :class:`int`:。"
57715792
57725793#: ../../library/stdtypes.rst:4828
57735794msgid ""
57745795"The builtin functions :func:`isinstance` and :func:`issubclass` do not "
57755796"accept ``GenericAlias`` types for their second argument::"
57765797msgstr ""
5798+ "内置函数 :func:`isinstance` 和 :func:`issubclass` 不接受第二个参数为``GenericAlias`` 类型:"
57775799
57785800#: ../../library/stdtypes.rst:4836
57795801msgid ""
@@ -5783,24 +5805,26 @@ msgid ""
57835805"their type. For example, the following code is discouraged, but will run "
57845806"without errors::"
57855807msgstr ""
5808+ "Python 运行时不会强制执行 :term:`type annotations <annotation>`。这种方式延伸到了泛型及其类型参数。当由 "
5809+ "``GenericAlias`` 创建对象时,不会检查容器元素的类型。例如,以下代码虽不值得鼓励,但运行时不会出错:"
57865810
57875811#: ../../library/stdtypes.rst:4846
57885812msgid ""
57895813"Furthermore, parameterized generics erase type parameters during object "
57905814"creation::"
5791- msgstr ""
5815+ msgstr "不仅如此,在创建对象的过程中,应用了参数后的泛型还会抹除类型参数: "
57925816
57935817#: ../../library/stdtypes.rst:4857
57945818msgid ""
57955819"Calling :func:`repr` or :func:`str` on a generic shows the parameterized "
57965820"type::"
5797- msgstr ""
5821+ msgstr "在泛型上调用 :func:`repr` 或 :func:`str` 会显示应用参数之后的类型: "
57985822
57995823#: ../../library/stdtypes.rst:4865
58005824msgid ""
58015825"The :meth:`__getitem__` method of generics will raise an exception to "
58025826"disallow mistakes like ``dict[str][str]``::"
5803- msgstr ""
5827+ msgstr "调用泛型的 :meth:`__getitem__` 方法将触发异常,以防出现 ``dict[str][str]`` 之类的错误: "
58045828
58055829#: ../../library/stdtypes.rst:4873
58065830msgid ""
@@ -5809,178 +5833,180 @@ msgid ""
58095833"items in the ``GenericAlias`` object's :attr:`__args__ "
58105834"<genericalias.__args__>`. ::"
58115835msgstr ""
5836+ "不过在用到 :ref:`type variables <generics>` 时,这种表达式是有效的。索引元素数量必须与 "
5837+ "``GenericAlias`` 对象的 :attr:`__args__ <genericalias.__args__>` 的类型变量项数一样。"
58125838
58135839#: ../../library/stdtypes.rst:4884
58145840msgid "Standard Generic Collections"
5815- msgstr ""
5841+ msgstr "标准的泛型集合类 "
58165842
58175843#: ../../library/stdtypes.rst:4886
58185844msgid "These standard library collections support parameterized generics."
5819- msgstr ""
5845+ msgstr "以下标准集合类支持参数化泛型: "
58205846
58215847#: ../../library/stdtypes.rst:4888
58225848msgid ":class:`tuple`"
5823- msgstr ""
5849+ msgstr ":class:`tuple` "
58245850
58255851#: ../../library/stdtypes.rst:4889
58265852msgid ":class:`list`"
5827- msgstr ""
5853+ msgstr ":class:`list` "
58285854
58295855#: ../../library/stdtypes.rst:4890
58305856msgid ":class:`dict`"
5831- msgstr ""
5857+ msgstr ":class:`dict` "
58325858
58335859#: ../../library/stdtypes.rst:4891
58345860msgid ":class:`set`"
5835- msgstr ""
5861+ msgstr ":class:`set` "
58365862
58375863#: ../../library/stdtypes.rst:4892
58385864msgid ":class:`frozenset`"
5839- msgstr ""
5865+ msgstr ":class:`frozenset` "
58405866
58415867#: ../../library/stdtypes.rst:4893
58425868msgid ":class:`type`"
5843- msgstr ""
5869+ msgstr ":class:`type` "
58445870
58455871#: ../../library/stdtypes.rst:4894
58465872msgid ":class:`collections.deque`"
5847- msgstr ""
5873+ msgstr ":class:`collections.deque` "
58485874
58495875#: ../../library/stdtypes.rst:4895
58505876msgid ":class:`collections.defaultdict`"
5851- msgstr ""
5877+ msgstr ":class:`collections.defaultdict` "
58525878
58535879#: ../../library/stdtypes.rst:4896
58545880msgid ":class:`collections.OrderedDict`"
5855- msgstr ""
5881+ msgstr ":class:`collections.OrderedDict` "
58565882
58575883#: ../../library/stdtypes.rst:4897
58585884msgid ":class:`collections.Counter`"
5859- msgstr ""
5885+ msgstr ":class:`collections.Counter` "
58605886
58615887#: ../../library/stdtypes.rst:4898
58625888msgid ":class:`collections.ChainMap`"
5863- msgstr ""
5889+ msgstr ":class:`collections.ChainMap` "
58645890
58655891#: ../../library/stdtypes.rst:4899
58665892msgid ":class:`collections.abc.Awaitable`"
5867- msgstr ""
5893+ msgstr ":class:`collections.abc.Awaitable` "
58685894
58695895#: ../../library/stdtypes.rst:4900
58705896msgid ":class:`collections.abc.Coroutine`"
5871- msgstr ""
5897+ msgstr ":class:`collections.abc.Coroutine` "
58725898
58735899#: ../../library/stdtypes.rst:4901
58745900msgid ":class:`collections.abc.AsyncIterable`"
5875- msgstr ""
5901+ msgstr ":class:`collections.abc.AsyncIterable` "
58765902
58775903#: ../../library/stdtypes.rst:4902
58785904msgid ":class:`collections.abc.AsyncIterator`"
5879- msgstr ""
5905+ msgstr ":class:`collections.abc.AsyncIterable` "
58805906
58815907#: ../../library/stdtypes.rst:4903
58825908msgid ":class:`collections.abc.AsyncGenerator`"
5883- msgstr ""
5909+ msgstr ":class:`collections.abc.AsyncGenerator` "
58845910
58855911#: ../../library/stdtypes.rst:4904
58865912msgid ":class:`collections.abc.Iterable`"
5887- msgstr ""
5913+ msgstr ":class:`collections.abc.Iterable` "
58885914
58895915#: ../../library/stdtypes.rst:4905
58905916msgid ":class:`collections.abc.Iterator`"
5891- msgstr ""
5917+ msgstr ":class:`collections.abc.Iterator` "
58925918
58935919#: ../../library/stdtypes.rst:4906
58945920msgid ":class:`collections.abc.Generator`"
5895- msgstr ""
5921+ msgstr ":class:`collections.abc.Generator` "
58965922
58975923#: ../../library/stdtypes.rst:4907
58985924msgid ":class:`collections.abc.Reversible`"
5899- msgstr ""
5925+ msgstr ":class:`collections.abc.Reversible` "
59005926
59015927#: ../../library/stdtypes.rst:4908
59025928msgid ":class:`collections.abc.Container`"
5903- msgstr ""
5929+ msgstr ":class:`collections.abc.Container` "
59045930
59055931#: ../../library/stdtypes.rst:4909
59065932msgid ":class:`collections.abc.Collection`"
5907- msgstr ""
5933+ msgstr ":class:`collections.abc.Collection` "
59085934
59095935#: ../../library/stdtypes.rst:4910
59105936msgid ":class:`collections.abc.Callable`"
5911- msgstr ""
5937+ msgstr ":class:`collections.abc.Callable` "
59125938
59135939#: ../../library/stdtypes.rst:4911
59145940msgid ":class:`collections.abc.Set`"
5915- msgstr ""
5941+ msgstr ":class:`collections.abc.Set` "
59165942
59175943#: ../../library/stdtypes.rst:4912
59185944msgid ":class:`collections.abc.MutableSet`"
5919- msgstr ""
5945+ msgstr ":class:`collections.abc.MutableSet` "
59205946
59215947#: ../../library/stdtypes.rst:4913
59225948msgid ":class:`collections.abc.Mapping`"
5923- msgstr ""
5949+ msgstr ":class:`collections.abc.Mapping` "
59245950
59255951#: ../../library/stdtypes.rst:4914
59265952msgid ":class:`collections.abc.MutableMapping`"
5927- msgstr ""
5953+ msgstr ":class:`collections.abc.MutableMapping` "
59285954
59295955#: ../../library/stdtypes.rst:4915
59305956msgid ":class:`collections.abc.Sequence`"
5931- msgstr ""
5957+ msgstr ":class:`collections.abc.Sequence` "
59325958
59335959#: ../../library/stdtypes.rst:4916
59345960msgid ":class:`collections.abc.MutableSequence`"
5935- msgstr ""
5961+ msgstr ":class:`collections.abc.MutableSequence` "
59365962
59375963#: ../../library/stdtypes.rst:4917
59385964msgid ":class:`collections.abc.ByteString`"
5939- msgstr ""
5965+ msgstr ":class:`collections.abc.ByteString` "
59405966
59415967#: ../../library/stdtypes.rst:4918
59425968msgid ":class:`collections.abc.MappingView`"
5943- msgstr ""
5969+ msgstr ":class:`collections.abc.MappingView` "
59445970
59455971#: ../../library/stdtypes.rst:4919
59465972msgid ":class:`collections.abc.KeysView`"
5947- msgstr ""
5973+ msgstr ":class:`collections.abc.KeysView` "
59485974
59495975#: ../../library/stdtypes.rst:4920
59505976msgid ":class:`collections.abc.ItemsView`"
5951- msgstr ""
5977+ msgstr ":class:`collections.abc.ItemsView` "
59525978
59535979#: ../../library/stdtypes.rst:4921
59545980msgid ":class:`collections.abc.ValuesView`"
5955- msgstr ""
5981+ msgstr ":class:`collections.abc.ValuesView` "
59565982
59575983#: ../../library/stdtypes.rst:4922
59585984msgid ":class:`contextlib.AbstractContextManager`"
5959- msgstr ""
5985+ msgstr ":class:`contextlib.AbstractContextManager` "
59605986
59615987#: ../../library/stdtypes.rst:4923
59625988msgid ":class:`contextlib.AbstractAsyncContextManager`"
5963- msgstr ""
5989+ msgstr ":class:`contextlib.AbstractAsyncContextManager` "
59645990
59655991#: ../../library/stdtypes.rst:4924
59665992msgid ":ref:`re.Pattern <re-objects>`"
5967- msgstr ""
5993+ msgstr ":ref:`re.Pattern <re-objects>` "
59685994
59695995#: ../../library/stdtypes.rst:4925
59705996msgid ":ref:`re.Match <match-objects>`"
5971- msgstr ""
5997+ msgstr ":ref:`re.Match <match-objects>` "
59725998
59735999#: ../../library/stdtypes.rst:4929
59746000msgid "Special Attributes of Generic Alias"
5975- msgstr ""
6001+ msgstr "泛型的特殊属性 "
59766002
59776003#: ../../library/stdtypes.rst:4931
59786004msgid "All parameterized generics implement special read-only attributes."
5979- msgstr ""
6005+ msgstr "应用参数后的泛型都实现了一些特殊的只读属性: "
59806006
59816007#: ../../library/stdtypes.rst:4935
59826008msgid "This attribute points at the non-parameterized generic class::"
5983- msgstr ""
6009+ msgstr "本属性指向未应用参数之前的泛型类: "
59846010
59856011#: ../../library/stdtypes.rst:4943
59866012msgid ""
0 commit comments