Skip to content

Commit e3e8270

Browse files
sync with cpython ad273f76
1 parent c210755 commit e3e8270

File tree

9 files changed

+1380
-1180
lines changed

9 files changed

+1380
-1180
lines changed

howto/enum.po

Lines changed: 153 additions & 231 deletions
Large diffs are not rendered by default.

library/array.po

Lines changed: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ msgid ""
1010
msgstr ""
1111
"Project-Id-Version: Python 3.14\n"
1212
"Report-Msgid-Bugs-To: \n"
13-
"POT-Creation-Date: 2026-01-12 00:16+0000\n"
13+
"POT-Creation-Date: 2026-03-24 00:18+0000\n"
1414
"PO-Revision-Date: 2021-11-23 18:40+0800\n"
1515
"Last-Translator: Benson Chen <bc842017@gmail.com>\n"
1616
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -36,9 +36,9 @@ msgid ""
3636
"character. The following type codes are defined:"
3737
msgstr ""
3838
"這個模組定義了一個物件型別,可以簡潔的表達一個包含基本數值的陣列:字元、整"
39-
"數、浮點數。陣列是一個非常類似 list(串列)的\\ :term:`序列 <sequence>`\\ 型別,除了陣"
40-
"列會限制儲存的物件型別。在建立陣列時可以使用一個字元的 :dfn:`type code` 來指定儲存的資料"
41-
"型別。以下為有被定義的 type codes:"
39+
"數、浮點數。陣列是一個非常類似 list(串列)的\\ :term:`序列 <sequence>`\\ "
40+
"別,除了陣列會限制儲存的物件型別。在建立陣列時可以使用一個字元的 :dfn:`type "
41+
"code` 來指定儲存的資料型別。以下為有被定義的 type codes:"
4242

4343
#: ../../library/array.rst:19
4444
msgid "Type code"
@@ -234,7 +234,15 @@ msgstr ""
234234
msgid "Please migrate to ``'w'`` typecode."
235235
msgstr "請改用 ``'w'`` typecode。"
236236

237-
#: ../../library/array.rst:67
237+
#: ../../library/array.rst:68
238+
msgid ""
239+
"The :ref:`ctypes <ctypes-fundamental-data-types>` and :ref:`struct <format-"
240+
"characters>` modules, as well as third-party modules like `numpy <https://"
241+
"numpy.org/doc/stable/reference/arrays.interface.html#object."
242+
"__array_interface__>`__, use similar -- but slightly different -- type codes."
243+
msgstr ""
244+
245+
#: ../../library/array.rst:74
238246
msgid ""
239247
"The actual representation of values is determined by the machine "
240248
"architecture (strictly speaking, by the C implementation). The actual size "
@@ -243,19 +251,19 @@ msgstr ""
243251
"實際上數值的表示方法是被機器的架構所決定(更精準地說,被 C 的實作方法決定)。"
244252
"實際的大小可以透過 :attr:`array.itemsize` 屬性存取。"
245253

246-
#: ../../library/array.rst:71
254+
#: ../../library/array.rst:78
247255
msgid "The module defines the following item:"
248256
msgstr "這個模組定義了以下項目:"
249257

250-
#: ../../library/array.rst:76
258+
#: ../../library/array.rst:83
251259
msgid "A string with all available type codes."
252260
msgstr "一個包含所有可用的 type codes 的字串。"
253261

254-
#: ../../library/array.rst:79
262+
#: ../../library/array.rst:86
255263
msgid "The module defines the following type:"
256264
msgstr "這個模組定義了下方的型別:"
257265

258-
#: ../../library/array.rst:84
266+
#: ../../library/array.rst:91
259267
msgid ""
260268
"A new array whose items are restricted by *typecode*, and initialized from "
261269
"the optional *initializer* value, which must be a :class:`bytes` or :class:"
@@ -266,7 +274,7 @@ msgstr ""
266274
"*initializer* 必須是一個 :class:`bytes` 或 :class:`bytearray` 物件、一個 "
267275
"Unicode 字串或包含適當型別元素的可疊代物件 (iterable)。"
268276

269-
#: ../../library/array.rst:89
277+
#: ../../library/array.rst:96
270278
msgid ""
271279
"If given a :class:`bytes` or :class:`bytearray` object, the initializer is "
272280
"passed to the new array's :meth:`frombytes` method; if given a Unicode "
@@ -279,7 +287,7 @@ msgstr ""
279287
"方法;其他情況時, 一個 initializer 的可疊代物件將被傳入 :meth:`extend` 方法"
280288
"之中來將初始項目新增至陣列。"
281289

282-
#: ../../library/array.rst:96
290+
#: ../../library/array.rst:103
283291
msgid ""
284292
"Array objects support the ordinary :ref:`mutable <typesseq-mutable>` :term:"
285293
"`sequence` operations of indexing, slicing, concatenation, and "
@@ -288,34 +296,33 @@ msgid ""
288296
"is raised. Array objects also implement the buffer interface, and may be "
289297
"used wherever :term:`bytes-like objects <bytes-like object>` are supported."
290298
msgstr ""
291-
"陣列支援常見的\\ :ref:`可變 <typesseq-mutable>`\\ :term:"
292-
"`序列 <sequence>`\\ 操作,包含索引 (indexing)、切片 (slicing)、串接 "
293-
"(concatenation)、相乘 (multiplication) 等。當使用切片進行賦值時,賦值的陣列必"
294-
"須具備相同的 type code,其他型別的數值將導致 :exc:`TypeError`。陣列同時也實作"
295-
"了緩衝區介面,可以在任何支援 :term:`bytes-like objects <bytes-like object>` "
296-
"的地方使用。"
297-
298-
#: ../../library/array.rst:102
299+
"陣列支援常見的\\ :ref:`可變 <typesseq-mutable>`\\ :term:`序列 <sequence>`\\ "
300+
"操作,包含索引 (indexing)、切片 (slicing)、串接 (concatenation)、相乘 "
301+
"(multiplication) 等。當使用切片進行賦值時,賦值的陣列必須具備相同的 type "
302+
"code,其他型別的數值將導致 :exc:`TypeError`。陣列同時也實作了緩衝區介面,可以"
303+
"在任何支援 :term:`bytes-like objects <bytes-like object>` 的地方使用。"
304+
305+
#: ../../library/array.rst:109
299306
msgid ""
300307
"Raises an :ref:`auditing event <auditing>` ``array.__new__`` with arguments "
301308
"``typecode``, ``initializer``."
302309
msgstr ""
303310
"引發\\ :ref:`稽核事件 (auditing event) <auditing>` ``array.__new__`` 並附帶引"
304311
"數 ``typecode``、``initializer``。"
305312

306-
#: ../../library/array.rst:107
313+
#: ../../library/array.rst:114
307314
msgid "The typecode character used to create the array."
308315
msgstr "typecode 字元被用在建立陣列時。"
309316

310-
#: ../../library/array.rst:112
317+
#: ../../library/array.rst:119
311318
msgid "The length in bytes of one array item in the internal representation."
312319
msgstr "陣列當中的一個元素在內部需要的位元組長度。"
313320

314-
#: ../../library/array.rst:117
321+
#: ../../library/array.rst:124
315322
msgid "Append a new item with value *x* to the end of the array."
316323
msgstr "新增一個元素 *x* 到陣列的最尾端。"
317324

318-
#: ../../library/array.rst:122
325+
#: ../../library/array.rst:129
319326
msgid ""
320327
"Return a tuple ``(address, length)`` giving the current memory address and "
321328
"the length in elements of the buffer used to hold array's contents. The "
@@ -332,7 +339,7 @@ msgstr ""
332339
"用,例如 :c:func:`!ioctl` 指令。只要陣列存在且沒有使用任何更改長度的操作時,"
333340
"回傳的數值就有效。"
334341

335-
#: ../../library/array.rst:132
342+
#: ../../library/array.rst:139
336343
msgid ""
337344
"When using array objects from code written in C or C++ (the only way to "
338345
"effectively make use of this information), it makes more sense to use the "
@@ -344,7 +351,7 @@ msgstr ""
344351
"適當的做法是使用陣列物件支援的緩衝區介面。這個方法維護了向後兼容性,並應該在"
345352
"新的程式碼中避免。關於緩衝區介面的文件在\\ :ref:`bufferobjects`。"
346353

347-
#: ../../library/array.rst:141
354+
#: ../../library/array.rst:148
348355
msgid ""
349356
"\"Byteswap\" all items of the array. This is only supported for values "
350357
"which are 1, 2, 4, or 8 bytes in size; for other types of values, :exc:"
@@ -355,11 +362,11 @@ msgstr ""
355362
"列,其他型別的值會導致 :exc:`RuntimeError`。這在從機器讀取位元順序不同的檔案"
356363
"時很有用。"
357364

358-
#: ../../library/array.rst:149
365+
#: ../../library/array.rst:156
359366
msgid "Return the number of occurrences of *x* in the array."
360367
msgstr "回傳 *x* 在陣列中出現了幾次。"
361368

362-
#: ../../library/array.rst:154
369+
#: ../../library/array.rst:161
363370
msgid ""
364371
"Append items from *iterable* to the end of the array. If *iterable* is "
365372
"another array, it must have *exactly* the same type code; if not, :exc:"
@@ -371,7 +378,7 @@ msgstr ""
371378
"個陣列,它必須可以被疊代 (iterable) 且其中的元素必須是可以被加入陣列中的正確"
372379
"型別。"
373380

374-
#: ../../library/array.rst:162
381+
#: ../../library/array.rst:169
375382
msgid ""
376383
"Appends items from the :term:`bytes-like object`, interpreting its content "
377384
"as an array of machine values (as if it had been read from a file using the :"
@@ -380,11 +387,11 @@ msgstr ""
380387
"從 :term:`bytes-like object` 中新增元素。讀取時會將其內容當作一個機器數值組成"
381388
"的陣列(就像從檔案中使用 :meth:`fromfile` 方法讀出的資料)。"
382389

383-
#: ../../library/array.rst:166
390+
#: ../../library/array.rst:173
384391
msgid ":meth:`!fromstring` is renamed to :meth:`frombytes` for clarity."
385392
msgstr "將 :meth:`!fromstring` 更名為 :meth:`frombytes`,使其更加清晰易懂。"
386393

387-
#: ../../library/array.rst:172
394+
#: ../../library/array.rst:179
388395
msgid ""
389396
"Read *n* items (as machine values) from the :term:`file object` *f* and "
390397
"append them to the end of the array. If less than *n* items are available, :"
@@ -395,15 +402,15 @@ msgstr ""
395402
"入陣列的最尾端。如果只有少於 *n* 個有效的元素會導致 :exc:`EOFError`,但有效的"
396403
"元素仍然會被加入陣列中。"
397404

398-
#: ../../library/array.rst:180
405+
#: ../../library/array.rst:187
399406
msgid ""
400407
"Append items from the list. This is equivalent to ``for x in list: a."
401408
"append(x)`` except that if there is a type error, the array is unchanged."
402409
msgstr ""
403410
"從 list 中新增元素。這等價於 ``for x in list: a.append(x)``,除了有型別錯誤產"
404411
"生時,陣列會保持原狀不會被更改。"
405412

406-
#: ../../library/array.rst:186
413+
#: ../../library/array.rst:193
407414
msgid ""
408415
"Extends this array with data from the given Unicode string. The array must "
409416
"have type code ``'u'`` or ``'w'``; otherwise a :exc:`ValueError` is raised. "
@@ -415,7 +422,7 @@ msgstr ""
415422
"frombytes(unicodestring.encode(enc))`` 來新增 Unicode 資料到一個其他型別的陣"
416423
"列。"
417424

418-
#: ../../library/array.rst:194
425+
#: ../../library/array.rst:201
419426
msgid ""
420427
"Return the smallest *i* such that *i* is the index of the first occurrence "
421428
"of *x* in the array. The optional arguments *start* and *stop* can be "
@@ -426,17 +433,17 @@ msgstr ""
426433
"數 *start* 及 *stop* 則可以被用來在指定的陣列空間中搜尋 *x*。如果 *x* 不存在"
427434
"將導致 :exc:`ValueError`。"
428435

429-
#: ../../library/array.rst:199
436+
#: ../../library/array.rst:206
430437
msgid "Added optional *start* and *stop* parameters."
431438
msgstr "新增選擇性的參數 *start* 及 *stop*。"
432439

433-
#: ../../library/array.rst:205
440+
#: ../../library/array.rst:212
434441
msgid ""
435442
"Insert a new item with value *x* in the array before position *i*. Negative "
436443
"values are treated as being relative to the end of the array."
437444
msgstr "在位置 *i* 之前插入一個元素 *x*。負數的索引值會從陣列尾端開始數。"
438445

439-
#: ../../library/array.rst:211
446+
#: ../../library/array.rst:218
440447
msgid ""
441448
"Removes the item with the index *i* from the array and returns it. The "
442449
"optional argument defaults to ``-1``, so that by default the last item is "
@@ -445,19 +452,19 @@ msgstr ""
445452
"移除並回傳陣列索引值 *i* 的元素。選擇性的引數 *i* 預設為 ``-1``,所以預設會刪"
446453
"除並回傳最後一個元素。"
447454

448-
#: ../../library/array.rst:218
455+
#: ../../library/array.rst:225
449456
msgid "Remove the first occurrence of *x* from the array."
450457
msgstr "從陣列中刪除第一個出現的 *x*。"
451458

452-
#: ../../library/array.rst:223
459+
#: ../../library/array.rst:230
453460
msgid "Remove all elements from the array."
454461
msgstr "從陣列中刪除所有元素。"
455462

456-
#: ../../library/array.rst:230
463+
#: ../../library/array.rst:237
457464
msgid "Reverse the order of the items in the array."
458465
msgstr "反轉陣列中元素的順序。"
459466

460-
#: ../../library/array.rst:235
467+
#: ../../library/array.rst:242
461468
msgid ""
462469
"Convert the array to an array of machine values and return the bytes "
463470
"representation (the same sequence of bytes that would be written to a file "
@@ -466,19 +473,19 @@ msgstr ""
466473
"將陣列轉為另一個機器數值組成的陣列並回傳它的位元組表示(跟用 :meth:`tofile` "
467474
"方法寫入檔案時的位元序列相同)。"
468475

469-
#: ../../library/array.rst:239
476+
#: ../../library/array.rst:246
470477
msgid ":meth:`!tostring` is renamed to :meth:`tobytes` for clarity."
471478
msgstr "為了明確性,過去的 :meth:`!tostring` 已更名為 :meth:`tobytes`。"
472479

473-
#: ../../library/array.rst:245
480+
#: ../../library/array.rst:252
474481
msgid "Write all items (as machine values) to the :term:`file object` *f*."
475482
msgstr "將所有元素(作為機器數值)寫入 :term:`file object` *f*。"
476483

477-
#: ../../library/array.rst:250
484+
#: ../../library/array.rst:257
478485
msgid "Convert the array to an ordinary list with the same items."
479486
msgstr "不更改元素,將陣列轉為一般的 list。"
480487

481-
#: ../../library/array.rst:255
488+
#: ../../library/array.rst:262
482489
msgid ""
483490
"Convert the array to a Unicode string. The array must have a type ``'u'`` "
484491
"or ``'w'``; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()."
@@ -488,7 +495,7 @@ msgstr ""
488495
"列會引發 :exc:`ValueError`。請使用 ``array.tobytes().decode(enc)`` 來為其他型"
489496
"別的陣列轉為 Unicode 字串。"
490497

491-
#: ../../library/array.rst:260
498+
#: ../../library/array.rst:267
492499
msgid ""
493500
"The string representation of array objects has the form ``array(typecode, "
494501
"initializer)``. The *initializer* is omitted if the array is empty, "
@@ -507,7 +514,7 @@ msgstr ""
507514
"過 :func:`eval` 轉換回一個擁有相同型別及數值的陣列。如果它包含相應的浮點值,"
508515
"``inf`` 和 ``nan`` 也必須被定義。範例: ::"
509516

510-
#: ../../library/array.rst:272
517+
#: ../../library/array.rst:279
511518
msgid ""
512519
"array('l')\n"
513520
"array('w', 'hello \\u2641')\n"
@@ -519,19 +526,19 @@ msgstr ""
519526
"array('l', [1, 2, 3, 4, 5])\n"
520527
"array('d', [1.0, 2.0, 3.14, -inf, nan])"
521528

522-
#: ../../library/array.rst:280
529+
#: ../../library/array.rst:287
523530
msgid "Module :mod:`struct`"
524531
msgstr ":mod:`struct` 模組"
525532

526-
#: ../../library/array.rst:281
533+
#: ../../library/array.rst:288
527534
msgid "Packing and unpacking of heterogeneous binary data."
528535
msgstr "將包含不同資料類型的二進位資料包裝與解開包裝。"
529536

530-
#: ../../library/array.rst:283
537+
#: ../../library/array.rst:290
531538
msgid "`NumPy <https://numpy.org/>`_"
532539
msgstr "`NumPy <https://numpy.org/>`_"
533540

534-
#: ../../library/array.rst:284
541+
#: ../../library/array.rst:291
535542
msgid "The NumPy package defines another array type."
536543
msgstr "NumPy 套件定義了另一個陣列型別"
537544

0 commit comments

Comments
 (0)