Skip to content

Commit 53e913b

Browse files
committed
feat: translate library/numbers.po
1 parent c097ff5 commit 53e913b

File tree

1 file changed

+75
-15
lines changed

1 file changed

+75
-15
lines changed

library/numbers.po

+75-15
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,27 @@
33
# This file is distributed under the same license as the Python package.
44
#
55
# Translators:
6+
# Liang-Bo Wang <[email protected]>, 2016
7+
# Matt Wang <[email protected]>, 2022
68
msgid ""
79
msgstr ""
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 <[email protected]>\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 <[email protected]>\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
2225
msgid ":mod:`numbers` --- Numeric abstract base classes"
23-
msgstr ""
26+
msgstr ":mod:`numbers` --- 數值的抽象基底類別"
2427

2528
#: ../../library/numbers.rst:7
2629
msgid "**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."
3538
msgstr ""
39+
":mod:`numbers` 模組 (:pep:`3141`) 定義了數值\\ :term:`抽象基底類別 <abstract "
40+
"base class>` 的階層結構,其中逐一定義了更多操作。此模組中定義的型別都不可被實"
41+
"例化。"
3642

3743
#: ../../library/numbers.rst:18
3844
msgid ""
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)``."
4147
msgstr ""
48+
"數值階層結構的基礎。如果你只想確認引數 *x* 是不是數值、並不關心其型別,請使"
49+
"用 ``isinstance(x, Number)``。"
4250

4351
#: ../../library/numbers.rst:23
4452
msgid "The numeric tower"
45-
msgstr ""
53+
msgstr "數值的階層"
4654

4755
#: ../../library/numbers.rst:27
4856
msgid ""
@@ -52,57 +60,70 @@ msgid ""
5260
"``, ``*``, ``/``, ``**``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!"
5361
"=``. All except ``-`` and ``!=`` are abstract."
5462
msgstr ""
63+
"這個型別的子類別描述了複數並包含適用於內建 :class:`complex` 型別的操作。這些"
64+
"操作有::class:`complex` 和 :class:`bool` 的轉換、:attr:`.real`、:attr:`."
65+
"imag`、``+``、``-``、``*``、``/``、``**``、:func:`abs`、:meth:`conjugate`、"
66+
"``==`` 以及 ``!=``。除 ``-`` 和 ``!=`` 之外所有操作都是抽象的。"
5567

5668
#: ../../library/numbers.rst:35
5769
msgid "Abstract. Retrieves the real component of this number."
58-
msgstr ""
70+
msgstr "為抽象的。取得該數值的實數部分。"
5971

6072
#: ../../library/numbers.rst:39
6173
msgid "Abstract. Retrieves the imaginary component of this number."
62-
msgstr ""
74+
msgstr "為抽象的。取得該數值的虛數部分。"
6375

6476
#: ../../library/numbers.rst:43
6577
msgid ""
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
7183
msgid ""
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
7789
msgid ""
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 ``>=``."
8193
msgstr ""
94+
"簡單的說,有 :class:`float` 的轉換、:func:`math.trunc`、:func:`round`、:func:"
95+
"`math.floor`、:func:`math.ceil`、:func:`divmod`、``//``、``%``、 ``<``、"
96+
"``<=``、``>``、和 ``>=``。"
8297

8398
#: ../../library/numbers.rst:55
8499
msgid ""
85100
"Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, :"
86101
"attr:`~Complex.imag`, and :meth:`~Complex.conjugate`."
87102
msgstr ""
103+
"實數同樣提供 :func:`complex`、:attr:`~Complex.real`、:attr:`~Complex.imag` "
104+
"和 :meth:`~Complex.conjugate` 的預設值。"
88105

89106
#: ../../library/numbers.rst:61
90107
msgid ""
91108
"Subtypes :class:`Real` and adds :attr:`~Rational.numerator` and :attr:"
92109
"`~Rational.denominator` properties. It also provides a default for :func:"
93110
"`float`."
94111
msgstr ""
112+
":class:`Real` 的子型別,再加入 :attr:`~Rational.numerator` 和 :attr:"
113+
"`~Rational.denominator` 這兩種特性。它也會提供 :func:`float` 的預設值。"
95114

96115
#: ../../library/numbers.rst:65
97116
msgid ""
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."
101120
msgstr ""
121+
":attr:`~Rational.numerator` 和 :attr:`~Rational.denominator` 的值必須是 :"
122+
"class:`Integral` 的實例且 :attr:`~Rational.denominator` 要是正數。"
102123

103124
#: ../../library/numbers.rst:71 ../../library/numbers.rst:75
104125
msgid "Abstract."
105-
msgstr ""
126+
msgstr "為抽象的。"
106127

107128
#: ../../library/numbers.rst:80
108129
msgid ""
@@ -111,10 +132,14 @@ msgid ""
111132
"`~Rational.denominator`. Adds abstract methods for :func:`pow` with modulus "
112133
"and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``."
113134
msgstr ""
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
116141
msgid "Notes for type implementors"
117-
msgstr ""
142+
msgstr "給型別實作者的註記"
118143

119144
#: ../../library/numbers.rst:90
120145
msgid ""
@@ -123,21 +148,30 @@ msgid ""
123148
"the real numbers. For example, :class:`fractions.Fraction` implements :func:"
124149
"`hash` as follows::"
125150
msgstr ""
151+
"實作者需注意,相等的數值除了大小相等外,還必須擁有同樣的雜湊值。當使用兩個不"
152+
"同的實數擴充時,這可能是很微妙的。例如,:class:`fractions.Fraction` 底下的 :"
153+
"func:`hash` 實作如下:\n"
154+
"\n"
155+
"::"
126156

127157
#: ../../library/numbers.rst:109
128158
msgid "Adding More Numeric ABCs"
129-
msgstr ""
159+
msgstr "加入更多數值 ABC"
130160

131161
#: ../../library/numbers.rst:111
132162
msgid ""
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::"
136166
msgstr ""
167+
"當然,還有更多用於數值的 ABC,如果不加入它們就不會有健全的階層。你可以在 :"
168+
"class:`Complex` 和 :class:`Real` 中加入 ``MyFoo``,像是:\n"
169+
"\n"
170+
"::"
137171

138172
#: ../../library/numbers.rst:123
139173
msgid "Implementing the arithmetic operations"
140-
msgstr ""
174+
msgstr "實作算術操作"
141175

142176
#: ../../library/numbers.rst:125
143177
msgid ""
@@ -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::"
149183
msgstr ""
184+
"我們想要實作算術操作,來使得混合模式操作要麼呼叫一個作者知道兩個引數之型別的"
185+
"實作,要麼將其轉換成最接近的內建型別並執行這個操作。對於 :class:"
186+
"`Integral` 的子型別,這意味著 :meth:`__add__` 和 :meth:`__radd__` 必須用如下方式定"
187+
"義:\n"
188+
"\n"
189+
"::"
150190

151191
#: ../../library/numbers.rst:156
152192
msgid ""
@@ -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``:"
158198
msgstr ""
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
161205
msgid "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
165209
msgid ""
@@ -169,32 +213,44 @@ msgid ""
169213
"`NotImplemented` from :meth:`__add__`. (Or ``A`` may not implement :meth:"
170214
"`__add__` at all.)"
171215
msgstr ""
216+
"如果 ``A`` 回退成模板程式碼,它將回傳一個來自 :meth:`__add__` 的值,並喪失讓 "
217+
"``B`` 定義一個更完善的 :meth:`__radd__` 的機會,因此模板需要回傳一個來自 :"
218+
"meth:`__add__` 的 :const:`NotImplemented`。(或者 ``A`` 可能完全不實作 :meth:"
219+
"`__add__`。)"
172220

173221
#: ../../library/numbers.rst:171
174222
msgid ""
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
180228
msgid ""
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."
183231
msgstr ""
232+
"如果沒有成功回退到模板,就沒有更多的方法可以去嘗試,因此這裡將使用預設的實"
233+
"作。"
184234

185235
#: ../../library/numbers.rst:176
186236
msgid ""
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`."
190240
msgstr ""
241+
"如果 ``B <: A``,Python 會在 ``A.__add__`` 之前嘗試 ``B.__radd__``。這是可行"
242+
"的,因為它是透過對 ``A`` 的理解而實作的,所以這可以在交給 :class:`Complex` 之"
243+
"前處理好這些實例。"
191244

192245
#: ../../library/numbers.rst:181
193246
msgid ""
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``."
197250
msgstr ""
251+
"如果 ``A <: Complex`` 和 ``B <: Real`` 且沒有共享任何其他型別上的理解,那麼適當共享操作會涉"
252+
"及內建的 :class:`complex`,並且分別用到 :meth:`__radd__`,因此 ``a+b == b"
253+
"+a``。"
198254

199255
#: ../../library/numbers.rst:186
200256
msgid ""
@@ -203,3 +259,7 @@ msgid ""
203259
"reverse instances of any given operator. For example, :class:`fractions."
204260
"Fraction` uses::"
205261
msgstr ""
262+
"由於大部分對任意給定類型的操作都十分相似的,定義一個為任意給定運算子生成向前 (forward) 與向"
263+
"後 (reverse) 實例的輔助函式可能會非常有用。例如,:class:`fractions.Fraction` 使用了:\n"
264+
"\n"
265+
"::"

0 commit comments

Comments
 (0)