55#
66# Translators:
778- # Freesand Leo <[email protected] >, 2022 8+ # Freesand Leo <[email protected] >, 2023 99#
1010#, fuzzy
1111msgid ""
1212msgstr ""
1313"Project-Id-Version : Python 3.12\n "
1414"Report-Msgid-Bugs-To : \n "
15- "POT-Creation-Date : 2023-07-28 14:13+0000\n "
15+ "POT-Creation-Date : 2023-12-22 14:13+0000\n "
1616"PO-Revision-Date : 2021-06-28 01:10+0000\n "
17- "
Last-Translator :
Freesand Leo <[email protected] >, 2022 \n "
17+ "
Last-Translator :
Freesand Leo <[email protected] >, 2023 \n "
1818"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
1919"MIME-Version : 1.0\n "
2020"Content-Type : text/plain; charset=UTF-8\n "
@@ -32,13 +32,13 @@ msgstr "**源代码:** :source:`Lib/numbers.py`"
3232
3333#: ../../library/numbers.rst:11
3434msgid ""
35- "The :mod:`numbers` module (:pep:`3141`) defines a hierarchy of numeric "
35+ "The :mod:`! numbers` module (:pep:`3141`) defines a hierarchy of numeric "
3636":term:`abstract base classes <abstract base class>` which progressively "
3737"define more operations. None of the types defined in this module are "
3838"intended to be instantiated."
3939msgstr ""
40- ":mod:`numbers` 模块 (:pep:`3141`) 定义了数字 :term:`抽象基类 <abstract base class>` "
41- "的层级结构,其中逐级定义了更多操作 。 此模块中定义的类型都不可被实例化。"
40+ ":mod:`! numbers` 模块 (:pep:`3141`) 定义了数字 :term:`抽象基类 <abstract base class>` "
41+ "的层级结构,其中逐级定义了更多的操作 。 此模块中定义的类型都不可被实例化。"
4242
4343#: ../../library/numbers.rst:18
4444msgid ""
@@ -79,9 +79,9 @@ msgstr "抽象的。返回共轭复数。例如 ``(1+3j).conjugate() == (1-3j)``
7979
8080#: ../../library/numbers.rst:48
8181msgid ""
82- "To :class:`Complex`, :class:`Real` adds the operations that work on real "
82+ "To :class:`Complex`, :class:`! Real` adds the operations that work on real "
8383"numbers."
84- msgstr "相对于 :class:`Complex`,:class:`Real` 加入了只有实数才能进行的操作 。"
84+ msgstr "相对于 :class:`Complex`,:class:`! Real` 加入了只适用于实数的操作 。"
8585
8686#: ../../library/numbers.rst:51
8787msgid ""
@@ -172,13 +172,14 @@ msgid ""
172172"We want to implement the arithmetic operations so that mixed-mode operations"
173173" either call an implementation whose author knew about the types of both "
174174"arguments, or convert both to the nearest built in type and do the operation"
175- " there. For subtypes of :class:`Integral`, this means that :meth:`__add__` "
176- "and :meth:`__radd__` should be defined as::"
175+ " there. For subtypes of :class:`Integral`, this means that "
176+ ":meth:`~object.__add__` and :meth:`~object. __radd__` should be defined as::"
177177msgstr ""
178- "我们希望实现计算,因此,混合模式操作要么调用一个作者知道参数类型的实现,要么转变成为最接近的内置类型并对这个执行操作。对于子类 "
179- ":class:`Integral`,这意味着 :meth:`__add__` 和 :meth:`__radd__` 必须用如下方式定义:"
178+ "我们想要实现算术运算,因此混合模式运算要么调用一个开发者知道两个参数类型的实现,要么将两个参数转换为最接近的内置类型再执行运算。 对于 "
179+ ":class:`Integral` 的子类,这意味着 :meth:`~object.__add__` 和 "
180+ ":meth:`~object.__radd__` 应当被定义为::"
180181
181- #: ../../library/numbers.rst:156
182+ #: ../../library/numbers.rst:157
182183msgid ""
183184"There are 5 different cases for a mixed-type operation on subclasses of "
184185":class:`Complex`. I'll refer to all of the above code that doesn't refer to "
@@ -190,35 +191,37 @@ msgstr ""
190191"``OtherTypeIKnowAbout``。 ``a`` 是 :class:`Complex` 的子类型 ``A`` 的实例 (``a : A "
191192"<: Complex``),同时 ``b : B <: Complex``。 我将要计算 ``a + b``:"
192193
193- #: ../../library/numbers.rst:163
194- msgid "If ``A`` defines an :meth:`__add__` which accepts ``b``, all is well."
195- msgstr "如果 ``A`` 被定义成一个承认 ``b`` 的 :meth:`__add__`,一切都没有问题。"
194+ #: ../../library/numbers.rst:164
195+ msgid ""
196+ "If ``A`` defines an :meth:`~object.__add__` which accepts ``b``, all is "
197+ "well."
198+ msgstr "如果 ``A`` 定义了接受 ``b`` 的 :meth:`~object.__add__`,一切都没有问题。"
196199
197- #: ../../library/numbers.rst:165
200+ #: ../../library/numbers.rst:166
198201msgid ""
199202"If ``A`` falls back to the boilerplate code, and it were to return a value "
200- "from :meth:`__add__`, we'd miss the possibility that ``B`` defines a more "
201- "intelligent :meth:`__radd__`, so the boilerplate should return "
202- ":const:`NotImplemented` from :meth:`__add__`. (Or ``A`` may not implement "
203- ":meth:`__add__` at all.)"
203+ "from :meth:`~object. __add__`, we'd miss the possibility that ``B`` defines a"
204+ " more intelligent :meth:`~object. __radd__`, so the boilerplate should return"
205+ " :const:`NotImplemented` from :meth:`! __add__`. (Or ``A`` may not implement "
206+ ":meth:`! __add__` at all.)"
204207msgstr ""
205- "如果 ``A`` 转回成“模板”失败,它将返回一个属于 :meth:`__add__` 的值,我们需要避免 ``B`` 定义了一个更加智能的 "
206- ":meth:`__radd__`,因此模板需要返回一个属于 :meth:`__add__` 的 :const:`NotImplemented` 。(或者 "
207- " ``A`` 可能完全不实现 :meth:`__add__` 。)"
208+ "如果 ``A`` 回退至基础代码,它将返回一个来自 :meth:`~object. __add__` 的值,我们就没有机会为 ``B`` 定义更加智能的 "
209+ ":meth:`~object. __radd__`,因此基础代码应当从 :meth:`! __add__` 返回 "
210+ ":const:`NotImplemented`。 (或者 ``A`` 可能完全不实现 :meth:`! __add__`。)"
208211
209- #: ../../library/numbers.rst:171
212+ #: ../../library/numbers.rst:172
210213msgid ""
211- "Then ``B``'s :meth:`__radd__` gets a chance. If it accepts ``a``, all is "
212- "well."
213- msgstr "接着看 ``B`` 的 :meth:`__radd__` 。如果它承认 ``a`` ,一切都没有问题。"
214+ "Then ``B``'s :meth:`~object. __radd__` gets a chance. If it accepts ``a``, "
215+ "all is well."
216+ msgstr "那么 ``B`` 的 :meth:`~object. __radd__` 将有机会发挥作用。 如果它接受 ``a``,一切都没有问题。"
214217
215- #: ../../library/numbers.rst:173
218+ #: ../../library/numbers.rst:174
216219msgid ""
217220"If it falls back to the boilerplate, there are no more possible methods to "
218221"try, so this is where the default implementation should live."
219222msgstr "如果没有成功回退到模板,就没有更多的方法可以去尝试,因此这里将使用默认的实现。"
220223
221- #: ../../library/numbers.rst:176
224+ #: ../../library/numbers.rst:177
222225msgid ""
223226"If ``B <: A``, Python tries ``B.__radd__`` before ``A.__add__``. This is ok,"
224227" because it was implemented with knowledge of ``A``, so it can handle those "
@@ -227,16 +230,17 @@ msgstr ""
227230"如果 ``B <: A`` , Python 在 ``A.__add__`` 之前尝试 ``B.__radd__`` 。 这是可行的,是通过对 "
228231"``A`` 的认识实现的,因此这可以在交给 :class:`Complex` 处理之前处理这些实例。"
229232
230- #: ../../library/numbers.rst:181
233+ #: ../../library/numbers.rst:182
231234msgid ""
232235"If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, "
233236"then the appropriate shared operation is the one involving the built in "
234- ":class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``."
237+ ":class:`complex`, and both :meth:`~object.__radd__` s land there, so ``a+b "
238+ "== b+a``."
235239msgstr ""
236- "如果 ``A <: Complex`` 和 ``B <: Real`` 没有共享任何资源,那么适当的共享操作涉及内置的 :class:`complex`"
237- " ,并且分别获得 :meth:`__radd__` ,因此 ``a+b == b+a``。"
240+ "如果 ``A <: Complex`` 和 ``B <: Real`` 没有共享任何其他信息,那么内置 :class:`complex` "
241+ "的共享操作就是最适当的,两个 :meth:`~object. __radd__` 都将应用该操作 ,因此 ``a+b == b+a``。"
238242
239- #: ../../library/numbers.rst:186
243+ #: ../../library/numbers.rst:187
240244msgid ""
241245"Because most of the operations on any given type will be very similar, it "
242246"can be useful to define a helper function which generates the forward and "
0 commit comments