1414# MuSheng Chen <[email protected] >, 20201515# Freesand Leo <[email protected] >, 20201616# Siyuan Xu <[email protected] >, 202017+ # jaystone776, 2020
1718#
1819#, fuzzy
1920msgid ""
@@ -22,7 +23,7 @@ msgstr ""
2223"Report-Msgid-Bugs-To : \n "
2324"POT-Creation-Date : 2020-12-21 04:56+0000\n "
2425"PO-Revision-Date : 2017-02-16 23:32+0000\n "
25- "
Last-Translator :
Siyuan Xu <[email protected] > , 2020\n"
26+ "Last-Translator : jaystone776 , 2020\n "
2627"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2728"MIME-Version : 1.0\n "
2829"Content-Type : text/plain; charset=UTF-8\n "
@@ -43,7 +44,7 @@ msgid ""
4344"The Python runtime does not enforce function and variable type annotations. "
4445"They can be used by third party tools such as type checkers, IDEs, linters, "
4546"etc."
46- msgstr " Python 运行时并不强制标注函数和变量类型。类型标注可被用于第三方工具,比如类型检查器 、集成开发环境、静态检查器等 。"
47+ msgstr " Python 运行时不强制标注函数和变量类型。类型标注可用于类型检查器 、集成开发环境、静态检查器等第三方工具 。"
4748
4849#: ../../library/typing.rst:20
4950msgid ""
@@ -54,24 +55,24 @@ msgid ""
5455":class:`Generic`. For full specification please see :pep:`484`. For a "
5556"simplified introduction to type hints see :pep:`483`."
5657msgstr ""
57- "此模块为运行时提供了 :pep:`484` 、 :pep:`526` 、 :pep:`544` 、 :pep:`586` 、 :pep:`589` 和 "
58- ":pep:`591` 规定的类型提示 。最基本的支持由 "
58+ "本模块为 :pep:`484` 、 :pep:`526` 、 :pep:`544` 、 :pep:`586` 、 :pep:`589` 和 "
59+ ":pep:`591` 规定的类型提示提供运行时支持 。最基本的支持由 "
5960":data:`Any`,:data:`Union`,:data:`Tuple`,:data:`Callable`,:class:`TypeVar` 和 "
60- ":class:`Generic` 类型组成。有关完整的规范,请参阅 :pep:`484`。有关类型提示的简单介绍,请参阅 :PEP:`483`。"
61+ ":class:`Generic` 类型组成。完整规范请参阅 :pep:`484`。类型提示简绍请参阅 :PEP:`483`。"
6162
6263#: ../../library/typing.rst:28
6364msgid ""
6465"The function below takes and returns a string and is annotated as follows::"
65- msgstr "函数接受并返回一个字符串,注释像下面这样 ::"
66+ msgstr "下述函数接收,并返回字符串,注释方式如下 ::"
6667
6768#: ../../library/typing.rst:33
6869msgid ""
6970"In the function ``greeting``, the argument ``name`` is expected to be of "
7071"type :class:`str` and the return type :class:`str`. Subtypes are accepted as"
7172" arguments."
7273msgstr ""
73- "在函数 ``greeting`` 中 ,参数 ``name`` 预期是 :class:`str` 类型,并且返回 :class:`str` "
74- "类型。子类型允许作为参数 。"
74+ "``greeting`` 函数中 ,参数 ``name`` 为类型 :class:`str` ,返回类型也是 :class:`str` "
75+ "。子类型也可以当作参数 。"
7576
7677#: ../../library/typing.rst:38
7778msgid "Type aliases"
@@ -82,33 +83,33 @@ msgid ""
8283"A type alias is defined by assigning the type to the alias. In this example,"
8384" ``Vector`` and ``list[float]`` will be treated as interchangeable "
8485"synonyms::"
85- msgstr "要定义一个类型别名,可以将一个类型赋给别名。在本例中 ,``Vector`` 和 ``list[float]`` 将被视为可互换的同义词 :"
86+ msgstr "将类型赋值给别名,即可定义类型别名。本例中 ,``Vector`` 和 ``list[float]`` 是可互换的同义词 :"
8687
8788#: ../../library/typing.rst:51
8889msgid ""
8990"Type aliases are useful for simplifying complex type signatures. For "
9091"example::"
91- msgstr "类型别名可用于简化复杂类型签名 。例如::"
92+ msgstr "类型别名适用于简化复杂的类型签名 。例如::"
9293
9394#: ../../library/typing.rst:69
9495msgid ""
9596"Note that ``None`` as a type hint is a special case and is replaced by "
9697"``type(None)``."
97- msgstr "请注意 ,``None`` 作为类型提示是一种特殊情况,并且由 ``type(None)`` 取代。"
98+ msgstr "注意 ,``None`` 这种类型提示是特例,且已被 ``type(None)`` 取代。"
9899
99100#: ../../library/typing.rst:75
100101msgid "NewType"
101102msgstr "NewType"
102103
103104#: ../../library/typing.rst:77
104105msgid "Use the :func:`NewType` helper function to create distinct types::"
105- msgstr "使用 :func:`NewType` 辅助函数创建不同的类型 ::"
106+ msgstr ":func:`NewType` 辅助函数可创建其它类型 ::"
106107
107108#: ../../library/typing.rst:84
108109msgid ""
109110"The static type checker will treat the new type as if it were a subclass of "
110111"the original type. This is useful in helping catch logical errors::"
111- msgstr "静态类型检查器会将新类型视为它是原始类型的子类。这对于帮助捕捉逻辑错误非常有用 ::"
112+ msgstr "静态类型检查器把新类型当作原始类型的子类。这种方式适用于捕捉逻辑错误 ::"
112113
113114#: ../../library/typing.rst:96
114115msgid ""
@@ -117,8 +118,8 @@ msgid ""
117118"pass in a ``UserId`` wherever an ``int`` might be expected, but will prevent"
118119" you from accidentally creating a ``UserId`` in an invalid way::"
119120msgstr ""
120- "您仍然可以对 ``UserId`` 类型的变量执行所有的 ``int`` 支持的操作,但结果将始终为 ``int`` 类型。这可以让你在需要 "
121- "``int`` 的地方传入 ``UserId``,但会阻止你以无效的方式无意中创建 ``UserId``::"
121+ "``UserId`` 类型的变量仍可执行 ``int`` 支持的所有操作,但结果总是 ``int`` 类型。这种方式允许在需要 ``int`` "
122+ "的地方传入 ``UserId``,但会防止意外创建的无效 ``UserId``::"
122123
123124#: ../../library/typing.rst:104
124125msgid ""
@@ -128,9 +129,9 @@ msgid ""
128129"it. That means the expression ``Derived(some_value)`` does not create a new "
129130"class or introduce any overhead beyond that of a regular function call."
130131msgstr ""
131- "请注意,这些检查仅通过静态类型检查程序来强制 。在运行时,语句 ``Derived = NewType('Derived', Base)`` 将 "
132- "``Derived`` 设为一个函数,该函数立即返回您传递它的任何参数。这意味着表达式 ``Derived(some_value)`` "
133- "不会创建一个新的类或引入任何超出常规函数调用的开销 。"
132+ "注意,只有静态类型检查器强制执行这些检查 。在运行时,``Derived = NewType('Derived', Base)`` 语句把 "
133+ "``Derived`` 当作函数,该函数立即返回传递给它的任何参数。即,表达式 ``Derived(some_value)`` "
134+ "不会创建新类,或引入任何常规函数调用以外的开销 。"
134135
135136#: ../../library/typing.rst:110
136137msgid ""
0 commit comments