33# This file is distributed under the same license as the Python package.
44#
55# Translators:
6+ # Liang-Bo Wang <me@liang2.tw>, 2016
7+ # Matt Wang <mattwang44@gmail.com>, 2022
68msgid ""
79msgstr ""
810"Project-Id-Version :Python 3.11\n "
911"Report-Msgid-Bugs-To :\n "
10- "POT-Creation-Date :2022-09-05 00:20+0000 \n "
11- "PO-Revision-Date :2016 -11-19 00:32+0000 \n "
12- "Last-Translator :Liang-Bo Wang <me@liang2.tw >\n "
12+ "POT-Creation-Date :2022-10-16 04:24+0800 \n "
13+ "PO-Revision-Date :2022 -11-16 04:57+0800 \n "
14+ "Last-Translator :Matt Wang <mattwang44@gmail.com >\n "
1315"Language-Team :Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
1416"tw)\n "
1517"Language :zh_TW\n "
1618"MIME-Version :1.0\n "
1719"Content-Type :text/plain; charset=UTF-8\n "
1820"Content-Transfer-Encoding :8bit\n "
1921"Plural-Forms :nplurals=1; plural=0;\n "
22+ "X-Generator :Poedit 3.2\n "
2023
2124#: ../../library/numbers.rst:2
2225msgid ":mod:`numbers` --- Numeric abstract base classes"
23- msgstr ""
26+ msgstr ":mod:`numbers` --- 數值的抽象基底類別 "
2427
2528#: ../../library/numbers.rst:7
2629msgid "**Source code:** :source:`Lib/numbers.py`"
@@ -33,16 +36,21 @@ msgid ""
3336"more operations. None of the types defined in this module are intended to "
3437"be instantiated."
3538msgstr ""
39+ ":mod:`numbers` 模組 (:pep:`3141`) 定義了數值\\ :term:`抽象基底類別 <abstract "
40+ "base class>` 的階層結構,其中逐一定義了更多操作。此模組中定義的型別都不可被實"
41+ "例化。"
3642
3743#: ../../library/numbers.rst:18
3844msgid ""
3945"The root of the numeric hierarchy. If you just want to check if an argument "
4046"*x* is a number, without caring what kind, use ``isinstance(x, Number)``."
4147msgstr ""
48+ "數值階層結構的基礎。如果你只想確認引數 *x* 是不是數值、並不關心其型別,請使"
49+ "用 ``isinstance(x, Number)``。"
4250
4351#: ../../library/numbers.rst:23
4452msgid "The numeric tower"
45- msgstr ""
53+ msgstr "數值的階層 "
4654
4755#: ../../library/numbers.rst:27
4856msgid ""
@@ -52,57 +60,70 @@ msgid ""
5260"``, ``*``, ``/``, ``**``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!"
5361"=``. All except ``-`` and ``!=`` are abstract."
5462msgstr ""
63+ "這個型別的子類別描述了複數並包含適用於內建 :class:`complex` 型別的操作。這些"
64+ "操作有::class:`complex` 和 :class:`bool` 的轉換、:attr:`.real`、:attr:`."
65+ "imag`、``+``、``-``、``*``、``/``、``**``、:func:`abs`、:meth:`conjugate`、"
66+ "``==`` 以及 ``!=``。除 ``-`` 和 ``!=`` 之外所有操作都是抽象的。"
5567
5668#: ../../library/numbers.rst:35
5769msgid "Abstract. Retrieves the real component of this number."
58- msgstr ""
70+ msgstr "為抽象的。取得該數值的實數部分。 "
5971
6072#: ../../library/numbers.rst:39
6173msgid "Abstract. Retrieves the imaginary component of this number."
62- msgstr ""
74+ msgstr "為抽象的。取得該數值的虛數部分。 "
6375
6476#: ../../library/numbers.rst:43
6577msgid ""
6678"Abstract. Returns the complex conjugate. For example, ``(1+3j).conjugate() "
6779"== (1-3j)``."
68- msgstr ""
80+ msgstr "為抽象的。回傳共軛複數,例如 ``(1+3j).conjugate() == (1-3j)``。 "
6981
7082#: ../../library/numbers.rst:48
7183msgid ""
7284"To :class:`Complex`, :class:`Real` adds the operations that work on real "
7385"numbers."
74- msgstr ""
86+ msgstr "相對於 :class:`Complex`,:class:`Real` 加入了只有實數才能進行的操作。 "
7587
7688#: ../../library/numbers.rst:51
7789msgid ""
7890"In short, those are: a conversion to :class:`float`, :func:`math.trunc`, :"
7991"func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, "
8092"``%``, ``<``, ``<=``, ``>``, and ``>=``."
8193msgstr ""
94+ "簡單的說,有 :class:`float` 的轉換、:func:`math.trunc`、:func:`round`、:func:"
95+ "`math.floor`、:func:`math.ceil`、:func:`divmod`、``//``、``%``、 ``<``、"
96+ "``<=``、``>``、和 ``>=``。"
8297
8398#: ../../library/numbers.rst:55
8499msgid ""
85100"Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, :"
86101"attr:`~Complex.imag`, and :meth:`~Complex.conjugate`."
87102msgstr ""
103+ "實數同樣提供 :func:`complex`、:attr:`~Complex.real`、:attr:`~Complex.imag` "
104+ "和 :meth:`~Complex.conjugate` 的預設值。"
88105
89106#: ../../library/numbers.rst:61
90107msgid ""
91108"Subtypes :class:`Real` and adds :attr:`~Rational.numerator` and :attr:"
92109"`~Rational.denominator` properties. It also provides a default for :func:"
93110"`float`."
94111msgstr ""
112+ ":class:`Real` 的子型別,再加入 :attr:`~Rational.numerator` 和 :attr:"
113+ "`~Rational.denominator` 這兩種特性。它也會提供 :func:`float` 的預設值。"
95114
96115#: ../../library/numbers.rst:65
97116msgid ""
98117"The :attr:`~Rational.numerator` and :attr:`~Rational.denominator` values "
99118"should be instances of :class:`Integral` and should be in lowest terms with :"
100119"attr:`~Rational.denominator` positive."
101120msgstr ""
121+ ":attr:`~Rational.numerator` 和 :attr:`~Rational.denominator` 的值必須是 :"
122+ "class:`Integral` 的實例且 :attr:`~Rational.denominator` 要是正數。"
102123
103124#: ../../library/numbers.rst:71 ../../library/numbers.rst:75
104125msgid "Abstract."
105- msgstr ""
126+ msgstr "為抽象的。 "
106127
107128#: ../../library/numbers.rst:80
108129msgid ""
@@ -111,10 +132,14 @@ msgid ""
111132"`~Rational.denominator`. Adds abstract methods for :func:`pow` with modulus "
112133"and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``."
113134msgstr ""
135+ ":class:`Rational` 的子型別,並增加了 :class:`int` 的轉換操作。為 :func:"
136+ "`float`、:attr:`~Rational.numerator` 和 :attr:`~Rational.denominator` 提供了"
137+ "預設值。為 :func:`pow` 方法增加了求餘 (modulus) 和位元字串運算 (bit-string "
138+ "operations) 的抽象方法:``<<``、``>>``、``&``、``^``、``|``、``~``。"
114139
115140#: ../../library/numbers.rst:88
116141msgid "Notes for type implementors"
117- msgstr ""
142+ msgstr "給型別實作者的註記 "
118143
119144#: ../../library/numbers.rst:90
120145msgid ""
@@ -123,21 +148,30 @@ msgid ""
123148"the real numbers. For example, :class:`fractions.Fraction` implements :func:"
124149"`hash` as follows::"
125150msgstr ""
151+ "實作者需注意,相等的數值除了大小相等外,還必須擁有同樣的雜湊值。當使用兩個不"
152+ "同的實數擴充時,這可能是很微妙的。例如,:class:`fractions.Fraction` 底下的 :"
153+ "func:`hash` 實作如下:\n"
154+ "\n"
155+ "::"
126156
127157#: ../../library/numbers.rst:109
128158msgid "Adding More Numeric ABCs"
129- msgstr ""
159+ msgstr "加入更多數值 ABC "
130160
131161#: ../../library/numbers.rst:111
132162msgid ""
133163"There are, of course, more possible ABCs for numbers, and this would be a "
134164"poor hierarchy if it precluded the possibility of adding those. You can add "
135165"``MyFoo`` between :class:`Complex` and :class:`Real` with::"
136166msgstr ""
167+ "當然,還有更多用於數值的 ABC,如果不加入它們就不會有健全的階層。你可以在 :"
168+ "class:`Complex` 和 :class:`Real` 中加入 ``MyFoo``,像是:\n"
169+ "\n"
170+ "::"
137171
138172#: ../../library/numbers.rst:123
139173msgid "Implementing the arithmetic operations"
140- msgstr ""
174+ msgstr "實作算術操作 "
141175
142176#: ../../library/numbers.rst:125
143177msgid ""
@@ -147,6 +181,12 @@ msgid ""
147181"there. For subtypes of :class:`Integral`, this means that :meth:`__add__` "
148182"and :meth:`__radd__` should be defined as::"
149183msgstr ""
184+ "我們想要實作算術操作,來使得混合模式操作要麼呼叫一個作者知道兩個引數之型別的"
185+ "實作,要麼將其轉換成最接近的內建型別並執行這個操作。對於 :class:"
186+ "`Integral` 的子型別,這意味著 :meth:`__add__` 和 :meth:`__radd__` 必須用如下方式定"
187+ "義:\n"
188+ "\n"
189+ "::"
150190
151191#: ../../library/numbers.rst:156
152192msgid ""
@@ -156,10 +196,14 @@ msgid ""
156196"an instance of ``A``, which is a subtype of :class:`Complex` (``a : A <: "
157197"Complex``), and ``b : B <: Complex``. I'll consider ``a + b``:"
158198msgstr ""
199+ ":class:`Complex` 的子類別有 5 種不同的混合型別操作。我將上面提到所有不涉及 "
200+ "``MyIntegral`` 和 ``OtherTypeIKnowAbout`` 的程式碼稱作「模板 "
201+ "(boilerplate)」。``a`` 是 :class:`Complex` 之子型別 ``A`` 的實例 (``a : A "
202+ "<: Complex``),同時 ``b : B <: Complex``。我將要計算 ``a + b``:"
159203
160204#: ../../library/numbers.rst:163
161205msgid "If ``A`` defines an :meth:`__add__` which accepts ``b``, all is well."
162- msgstr ""
206+ msgstr "如果 ``A`` 有定義成一個接受 ``b`` 的 :meth:`__add__`,不會發生問題。 "
163207
164208#: ../../library/numbers.rst:165
165209msgid ""
@@ -169,32 +213,44 @@ msgid ""
169213"`NotImplemented` from :meth:`__add__`. (Or ``A`` may not implement :meth:"
170214"`__add__` at all.)"
171215msgstr ""
216+ "如果 ``A`` 回退成模板程式碼,它將回傳一個來自 :meth:`__add__` 的值,並喪失讓 "
217+ "``B`` 定義一個更完善的 :meth:`__radd__` 的機會,因此模板需要回傳一個來自 :"
218+ "meth:`__add__` 的 :const:`NotImplemented`。(或者 ``A`` 可能完全不實作 :meth:"
219+ "`__add__`。)"
172220
173221#: ../../library/numbers.rst:171
174222msgid ""
175223"Then ``B``'s :meth:`__radd__` gets a chance. If it accepts ``a``, all is "
176224"well."
177- msgstr ""
225+ msgstr "接著看 ``B`` 的 :meth:`__radd__`。如果它接受 ``a`` ,不會發生問題。 "
178226
179227#: ../../library/numbers.rst:173
180228msgid ""
181229"If it falls back to the boilerplate, there are no more possible methods to "
182230"try, so this is where the default implementation should live."
183231msgstr ""
232+ "如果沒有成功回退到模板,就沒有更多的方法可以去嘗試,因此這裡將使用預設的實"
233+ "作。"
184234
185235#: ../../library/numbers.rst:176
186236msgid ""
187237"If ``B <: A``, Python tries ``B.__radd__`` before ``A.__add__``. This is ok, "
188238"because it was implemented with knowledge of ``A``, so it can handle those "
189239"instances before delegating to :class:`Complex`."
190240msgstr ""
241+ "如果 ``B <: A``,Python 會在 ``A.__add__`` 之前嘗試 ``B.__radd__``。這是可行"
242+ "的,因為它是透過對 ``A`` 的理解而實作的,所以這可以在交給 :class:`Complex` 之"
243+ "前處理好這些實例。"
191244
192245#: ../../library/numbers.rst:181
193246msgid ""
194247"If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, "
195248"then the appropriate shared operation is the one involving the built in :"
196249"class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``."
197250msgstr ""
251+ "如果 ``A <: Complex`` 和 ``B <: Real`` 且沒有共享任何其他型別上的理解,那麼適當共享操作會涉"
252+ "及內建的 :class:`complex`,並且分別用到 :meth:`__radd__`,因此 ``a+b == b"
253+ "+a``。"
198254
199255#: ../../library/numbers.rst:186
200256msgid ""
@@ -203,3 +259,7 @@ msgid ""
203259"reverse instances of any given operator. For example, :class:`fractions."
204260"Fraction` uses::"
205261msgstr ""
262+ "由於大部分對任意給定類型的操作都十分相似的,定義一個為任意給定運算子生成向前 (forward) 與向"
263+ "後 (reverse) 實例的輔助函式可能會非常有用。例如,:class:`fractions.Fraction` 使用了:\n"
264+ "\n"
265+ "::"