1919# Arisaka97 <[email protected] >, 201920202121# Sean Chao <[email protected] >, 202022- # Freesand Leo <[email protected] >, 20212322# Jiuh-star <[email protected] >, 202123+ # Dai Xu <[email protected] >, 202124+ # Freesand Leo <[email protected] >, 20212425#
2526#, fuzzy
2627msgid ""
@@ -29,7 +30,7 @@ msgstr ""
2930"Report-Msgid-Bugs-To : \n "
3031"POT-Creation-Date : 2021-07-29 07:05+0000\n "
3132"PO-Revision-Date : 2017-02-16 23:27+0000\n "
32- "Last-Translator : Jiuh-star <jiuh.star@gmail .com>, 2021\n "
33+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2021\n "
3334"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
3435"MIME-Version : 1.0\n "
3536"Content-Type : text/plain; charset=UTF-8\n "
@@ -5696,14 +5697,16 @@ msgstr ""
56965697
56975698#: ../../library/stdtypes.rst:4736
56985699msgid "Generic Alias Type"
5699- msgstr ""
5700+ msgstr "GenericAlias 类型 "
57005701
57015702#: ../../library/stdtypes.rst:4742
57025703msgid ""
57035704"``GenericAlias`` objects are created by subscripting a class (usually a "
57045705"container), such as ``list[int]``. They are intended primarily for "
57055706":term:`type annotations <annotation>`."
57065707msgstr ""
5708+ "``GenericAlias`` 对象是通过对类(通常是容器类)作下标来创建的,如 ``list[int]`` 。主要用于 :term:`type "
5709+ "annotations <annotation>`。"
57075710
57085711#: ../../library/stdtypes.rst:4746
57095712msgid ""
@@ -5713,34 +5716,45 @@ msgid ""
57135716"of the class instead. The classmethod :meth:`__class_getitem__` should "
57145717"return a ``GenericAlias`` object."
57155718msgstr ""
5719+ "通常,容器对象的 :ref:`抽取 <subscriptions>` 操作会调用该对象的 :meth:`__getitem__` 方法。 "
5720+ "但是,对某些容器类执行抽取操作可能会改去调用该类的 :meth:`__class_getitem__` 类方法。 "
5721+ ":meth:`__class_getitem__` 类方法应当会返回一个 ``GenericAlias`` 对象。"
57165722
57175723#: ../../library/stdtypes.rst:4753
57185724msgid ""
57195725"If the :meth:`__getitem__` of the class' metaclass is present, it will take "
57205726"precedence over the :meth:`__class_getitem__` defined in the class (see "
57215727":pep:`560` for more details)."
57225728msgstr ""
5729+ "如果元类的 :meth:`__getitem__` 存在,将优先于类定义的 :meth:`__class_getitem__`(详见 "
5730+ ":pep:`560`)。"
57235731
57245732#: ../../library/stdtypes.rst:4757
57255733msgid ""
57265734"The ``GenericAlias`` object acts as a proxy for :term:`generic types "
57275735"<generic type>`, implementing *parameterized generics* - a specific instance"
57285736" of a generic which provides the types for container elements."
57295737msgstr ""
5738+ "``GenericAlias`` 对象作为 :term:`泛型类型 <generic type>` 的代理,具体实现 *形参化的泛型* —— "
5739+ "一个泛型的具体实例,为容器元素提供类型。"
57305740
57315741#: ../../library/stdtypes.rst:4761
57325742msgid ""
57335743"The user-exposed type for the ``GenericAlias`` object can be accessed from "
57345744":class:`types.GenericAlias` and used for :func:`isinstance` checks. It can "
57355745"also be used to create ``GenericAlias`` objects directly."
57365746msgstr ""
5747+ "用户通过 ``GenericAlias`` 对象暴露的类型可由 :class:`types.GenericAlias` 访问,并用于 "
5748+ ":func:`isinstance` 检查。也可用来直接创建 ``GenericAlias`` 对象。"
57375749
57385750#: ../../library/stdtypes.rst:4767
57395751msgid ""
57405752"Creates a ``GenericAlias`` representing a type ``T`` containing elements of "
57415753"types *X*, *Y*, and more depending on the ``T`` used. For example, a "
57425754"function expecting a :class:`list` containing :class:`float` elements::"
57435755msgstr ""
5756+ "创建代表类型 ``T`` 的 ``GenericAlias`` ,包含 *X* 、*Y* 等类型的元素,元素类型更多取决于所用的 "
5757+ "``T``。比如某函数需要包含 :class:`float` 元素的 :class:`list` :"
57445758
57455759#: ../../library/stdtypes.rst:4775
57465760msgid ""
@@ -5749,12 +5763,16 @@ msgid ""
57495763"the value type. In this example, the function expects a ``dict`` with keys "
57505764"of type :class:`str` and values of type :class:`int`::"
57515765msgstr ""
5766+ "另一个例子是关于 :term:`mapping` 对象的,用到了 "
5767+ ":class:`dict`,泛型的两个类型参数分别代表了键类型和值类型。本例中的函数需要一个 ``dict``,其键的类型为 "
5768+ ":class:`str`,值的类型为 :class:`int`:。"
57525769
57535770#: ../../library/stdtypes.rst:4783
57545771msgid ""
57555772"The builtin functions :func:`isinstance` and :func:`issubclass` do not "
57565773"accept ``GenericAlias`` types for their second argument::"
57575774msgstr ""
5775+ "内置函数 :func:`isinstance` 和 :func:`issubclass` 不接受第二个参数为``GenericAlias`` 类型:"
57585776
57595777#: ../../library/stdtypes.rst:4791
57605778msgid ""
@@ -5764,24 +5782,26 @@ msgid ""
57645782"their type. For example, the following code is discouraged, but will run "
57655783"without errors::"
57665784msgstr ""
5785+ "Python 运行时不会强制执行 :term:`type annotations <annotation>`。这种方式延伸到了泛型及其类型参数。当由 "
5786+ "``GenericAlias`` 创建对象时,不会检查容器元素的类型。例如,以下代码虽不值得鼓励,但运行时不会出错:"
57675787
57685788#: ../../library/stdtypes.rst:4801
57695789msgid ""
57705790"Furthermore, parameterized generics erase type parameters during object "
57715791"creation::"
5772- msgstr ""
5792+ msgstr "不仅如此,在创建对象的过程中,参数化的泛型还会抹除类型参数: "
57735793
57745794#: ../../library/stdtypes.rst:4812
57755795msgid ""
57765796"Calling :func:`repr` or :func:`str` on a generic shows the parameterized "
57775797"type::"
5778- msgstr ""
5798+ msgstr "在泛型上调用 :func:`repr` 或 :func:`str` 会显示应用参数之后的类型: "
57795799
57805800#: ../../library/stdtypes.rst:4820
57815801msgid ""
57825802"The :meth:`__getitem__` method of generics will raise an exception to "
57835803"disallow mistakes like ``dict[str][str]``::"
5784- msgstr ""
5804+ msgstr "调用泛型的 :meth:`__getitem__` 方法将触发异常,以防出现 ``dict[str][str]`` 之类的错误。 "
57855805
57865806#: ../../library/stdtypes.rst:4828
57875807msgid ""
@@ -5790,178 +5810,180 @@ msgid ""
57905810"items in the ``GenericAlias`` object's :attr:`__args__ "
57915811"<genericalias.__args__>`. ::"
57925812msgstr ""
5813+ "不过在用到 :ref:`type variables <generics>` 时,这种表达式是有效的。索引元素数量必须与 "
5814+ "``GenericAlias`` 对象的 :attr:`__args__ <genericalias.__args__>` 的类型变量项数一样。"
57935815
57945816#: ../../library/stdtypes.rst:4839
57955817msgid "Standard Generic Collections"
5796- msgstr ""
5818+ msgstr "标准的泛型集合类 "
57975819
57985820#: ../../library/stdtypes.rst:4841
57995821msgid "These standard library collections support parameterized generics."
5800- msgstr ""
5822+ msgstr "以下标准集合类支持参数化泛型: "
58015823
58025824#: ../../library/stdtypes.rst:4843
58035825msgid ":class:`tuple`"
5804- msgstr ""
5826+ msgstr ":class:`tuple` "
58055827
58065828#: ../../library/stdtypes.rst:4844
58075829msgid ":class:`list`"
5808- msgstr ""
5830+ msgstr ":class:`list` "
58095831
58105832#: ../../library/stdtypes.rst:4845
58115833msgid ":class:`dict`"
5812- msgstr ""
5834+ msgstr ":class:`dict` "
58135835
58145836#: ../../library/stdtypes.rst:4846
58155837msgid ":class:`set`"
5816- msgstr ""
5838+ msgstr ":class:`set` "
58175839
58185840#: ../../library/stdtypes.rst:4847
58195841msgid ":class:`frozenset`"
5820- msgstr ""
5842+ msgstr ":class:`frozenset` "
58215843
58225844#: ../../library/stdtypes.rst:4848
58235845msgid ":class:`type`"
5824- msgstr ""
5846+ msgstr ":class:`type` "
58255847
58265848#: ../../library/stdtypes.rst:4849
58275849msgid ":class:`collections.deque`"
5828- msgstr ""
5850+ msgstr ":class:`collections.deque` "
58295851
58305852#: ../../library/stdtypes.rst:4850
58315853msgid ":class:`collections.defaultdict`"
5832- msgstr ""
5854+ msgstr ":class:`collections.defaultdict` "
58335855
58345856#: ../../library/stdtypes.rst:4851
58355857msgid ":class:`collections.OrderedDict`"
5836- msgstr ""
5858+ msgstr ":class:`collections.OrderedDict` "
58375859
58385860#: ../../library/stdtypes.rst:4852
58395861msgid ":class:`collections.Counter`"
5840- msgstr ""
5862+ msgstr ":class:`collections.Counter` "
58415863
58425864#: ../../library/stdtypes.rst:4853
58435865msgid ":class:`collections.ChainMap`"
5844- msgstr ""
5866+ msgstr ":class:`collections.ChainMap` "
58455867
58465868#: ../../library/stdtypes.rst:4854
58475869msgid ":class:`collections.abc.Awaitable`"
5848- msgstr ""
5870+ msgstr ":class:`collections.abc.Awaitable` "
58495871
58505872#: ../../library/stdtypes.rst:4855
58515873msgid ":class:`collections.abc.Coroutine`"
5852- msgstr ""
5874+ msgstr ":class:`collections.abc.Coroutine` "
58535875
58545876#: ../../library/stdtypes.rst:4856
58555877msgid ":class:`collections.abc.AsyncIterable`"
5856- msgstr ""
5878+ msgstr ":class:`collections.abc.AsyncIterable` "
58575879
58585880#: ../../library/stdtypes.rst:4857
58595881msgid ":class:`collections.abc.AsyncIterator`"
5860- msgstr ""
5882+ msgstr ":class:`collections.abc.AsyncIterable` "
58615883
58625884#: ../../library/stdtypes.rst:4858
58635885msgid ":class:`collections.abc.AsyncGenerator`"
5864- msgstr ""
5886+ msgstr ":class:`collections.abc.AsyncGenerator` "
58655887
58665888#: ../../library/stdtypes.rst:4859
58675889msgid ":class:`collections.abc.Iterable`"
5868- msgstr ""
5890+ msgstr ":class:`collections.abc.Iterable` "
58695891
58705892#: ../../library/stdtypes.rst:4860
58715893msgid ":class:`collections.abc.Iterator`"
5872- msgstr ""
5894+ msgstr ":class:`collections.abc.Iterator` "
58735895
58745896#: ../../library/stdtypes.rst:4861
58755897msgid ":class:`collections.abc.Generator`"
5876- msgstr ""
5898+ msgstr ":class:`collections.abc.Generator` "
58775899
58785900#: ../../library/stdtypes.rst:4862
58795901msgid ":class:`collections.abc.Reversible`"
5880- msgstr ""
5902+ msgstr ":class:`collections.abc.Reversible` "
58815903
58825904#: ../../library/stdtypes.rst:4863
58835905msgid ":class:`collections.abc.Container`"
5884- msgstr ""
5906+ msgstr ":class:`collections.abc.Container` "
58855907
58865908#: ../../library/stdtypes.rst:4864
58875909msgid ":class:`collections.abc.Collection`"
5888- msgstr ""
5910+ msgstr ":class:`collections.abc.Collection` "
58895911
58905912#: ../../library/stdtypes.rst:4865
58915913msgid ":class:`collections.abc.Callable`"
5892- msgstr ""
5914+ msgstr ":class:`collections.abc.Callable` "
58935915
58945916#: ../../library/stdtypes.rst:4866
58955917msgid ":class:`collections.abc.Set`"
5896- msgstr ""
5918+ msgstr ":class:`collections.abc.Set` "
58975919
58985920#: ../../library/stdtypes.rst:4867
58995921msgid ":class:`collections.abc.MutableSet`"
5900- msgstr ""
5922+ msgstr ":class:`collections.abc.MutableSet` "
59015923
59025924#: ../../library/stdtypes.rst:4868
59035925msgid ":class:`collections.abc.Mapping`"
5904- msgstr ""
5926+ msgstr ":class:`collections.abc.Mapping` "
59055927
59065928#: ../../library/stdtypes.rst:4869
59075929msgid ":class:`collections.abc.MutableMapping`"
5908- msgstr ""
5930+ msgstr ":class:`collections.abc.MutableMapping` "
59095931
59105932#: ../../library/stdtypes.rst:4870
59115933msgid ":class:`collections.abc.Sequence`"
5912- msgstr ""
5934+ msgstr ":class:`collections.abc.Sequence` "
59135935
59145936#: ../../library/stdtypes.rst:4871
59155937msgid ":class:`collections.abc.MutableSequence`"
5916- msgstr ""
5938+ msgstr ":class:`collections.abc.MutableSequence` "
59175939
59185940#: ../../library/stdtypes.rst:4872
59195941msgid ":class:`collections.abc.ByteString`"
5920- msgstr ""
5942+ msgstr ":class:`collections.abc.ByteString` "
59215943
59225944#: ../../library/stdtypes.rst:4873
59235945msgid ":class:`collections.abc.MappingView`"
5924- msgstr ""
5946+ msgstr ":class:`collections.abc.MappingView` "
59255947
59265948#: ../../library/stdtypes.rst:4874
59275949msgid ":class:`collections.abc.KeysView`"
5928- msgstr ""
5950+ msgstr ":class:`collections.abc.KeysView` "
59295951
59305952#: ../../library/stdtypes.rst:4875
59315953msgid ":class:`collections.abc.ItemsView`"
5932- msgstr ""
5954+ msgstr ":class:`collections.abc.ItemsView` "
59335955
59345956#: ../../library/stdtypes.rst:4876
59355957msgid ":class:`collections.abc.ValuesView`"
5936- msgstr ""
5958+ msgstr ":class:`collections.abc.ValuesView` "
59375959
59385960#: ../../library/stdtypes.rst:4877
59395961msgid ":class:`contextlib.AbstractContextManager`"
5940- msgstr ""
5962+ msgstr ":class:`contextlib.AbstractContextManager` "
59415963
59425964#: ../../library/stdtypes.rst:4878
59435965msgid ":class:`contextlib.AbstractAsyncContextManager`"
5944- msgstr ""
5966+ msgstr ":class:`contextlib.AbstractAsyncContextManager` "
59455967
59465968#: ../../library/stdtypes.rst:4879
59475969msgid ":ref:`re.Pattern <re-objects>`"
5948- msgstr ""
5970+ msgstr ":ref:`re.Pattern <re-objects>` "
59495971
59505972#: ../../library/stdtypes.rst:4880
59515973msgid ":ref:`re.Match <match-objects>`"
5952- msgstr ""
5974+ msgstr ":ref:`re.Match <match-objects>` "
59535975
59545976#: ../../library/stdtypes.rst:4884
59555977msgid "Special Attributes of Generic Alias"
5956- msgstr ""
5978+ msgstr "泛型的特殊属性 "
59575979
59585980#: ../../library/stdtypes.rst:4886
59595981msgid "All parameterized generics implement special read-only attributes."
5960- msgstr ""
5982+ msgstr "应用参数后的泛型都实现了一些特殊的只读属性: "
59615983
59625984#: ../../library/stdtypes.rst:4890
59635985msgid "This attribute points at the non-parameterized generic class::"
5964- msgstr ""
5986+ msgstr "本属性指向未应用参数之前的泛型类: "
59655987
59665988#: ../../library/stdtypes.rst:4898
59675989msgid ""
0 commit comments