@@ -8,7 +8,7 @@ msgstr ""
8
8
"Project-Id-Version : Python 3.13\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
10
"POT-Creation-Date : 2024-11-02 00:13+0000\n "
11
- "PO-Revision-Date : 2023-09-11 14:08 +0800\n "
11
+ "PO-Revision-Date : 2024-12-21 13:50 +0800\n "
12
12
"Last-Translator : Adrian Liaw <adrianliaw2000@gmail.com>\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
14
"tw)\n "
@@ -85,6 +85,16 @@ msgid ""
85
85
">>> # functional syntax\n"
86
86
">>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])"
87
87
msgstr ""
88
+ ">>> from enum import Enum\n"
89
+ "\n"
90
+ ">>> # class 語法\n"
91
+ ">>> class Color(Enum):\n"
92
+ "... RED = 1\n"
93
+ "... GREEN = 2\n"
94
+ "... BLUE = 3\n"
95
+ "\n"
96
+ ">>> # 函式語法\n"
97
+ ">>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])"
88
98
89
99
#: ../../library/enum.rst:49
90
100
msgid ""
@@ -331,20 +341,19 @@ msgid ""
331
341
"to subclass *EnumType* -- see :ref:`Subclassing EnumType <enumtype-"
332
342
"examples>` for details."
333
343
msgstr ""
334
- "*EnumType* 是\\ *列舉* \\ 的 :term:`metaclass`。*EnumType* 可以有子類別 -- 細"
344
+ "*EnumType* 是 *enum* 列舉的 :term:`metaclass`。*EnumType* 可以有子類別 -- 細"
335
345
"節請參考 :ref:`建立 EnumType 的子類別 <enumtype-examples>`。"
336
346
337
347
#: ../../library/enum.rst:168
338
- #, fuzzy
339
348
msgid ""
340
349
"``EnumType`` is responsible for setting the correct :meth:`!__repr__`, :meth:"
341
350
"`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the "
342
351
"final *enum*, as well as creating the enum members, properly handling "
343
352
"duplicates, providing iteration over the enum class, etc."
344
353
msgstr ""
345
- "* EnumType* 負責在最後的\\ *列舉*\\ 上面設定正確的 :meth:`!__repr__`、:meth:`! "
346
- "__str__`、:meth:`!__format__` 及 :meth:`!__reduce__` 方法,以及建立列舉成員, "
347
- "並正確處理重複, 提供列舉類別的疊代等等。"
354
+ "`` EnumType`` 負責在最後的\\ *列舉*\\ 上面設定正確的 :meth:`!__repr__`、:meth:"
355
+ "`! __str__`、:meth:`!__format__` 及 :meth:`!__reduce__` 方法,以及建立列舉成 "
356
+ "員、正確處理重複、 提供列舉類別的疊代等等。"
348
357
349
358
#: ../../library/enum.rst:175
350
359
msgid "This method is called in two different ways:"
@@ -534,20 +543,22 @@ msgid ""
534
543
"Adds a new name as an alias to an existing member. Raises a :exc:"
535
544
"`NameError` if the name is already assigned to a different member."
536
545
msgstr ""
546
+ "新增一個名稱作為現有成員的別名。如果該名稱已被指派給不同的成員,則會引發 :"
547
+ "exc:`NameError`。"
537
548
538
549
#: ../../library/enum.rst:256
539
550
msgid ""
540
551
"Adds a new value as an alias to an existing member. Raises a :exc:"
541
552
"`ValueError` if the value is already linked with a different member."
542
553
msgstr ""
554
+ "新增一個值作為現有成員的別名。如果該值已與不同成員連結,則會引發 :exc:"
555
+ "`ValueError`。"
543
556
544
557
#: ../../library/enum.rst:261
545
- #, fuzzy
546
558
msgid ""
547
559
"Before 3.11 ``EnumType`` was called ``EnumMeta``, which is still available "
548
560
"as an alias."
549
- msgstr ""
550
- "在 3.11 之前,``enum`` 使用 ``EnumMeta`` 類型,目前保留此類型當作別名。"
561
+ msgstr "在 3.11 之前,``EnumType`` 稱作 ``EnumMeta``,其目前仍可作為別名使用。"
551
562
552
563
#: ../../library/enum.rst:266
553
564
msgid "*Enum* is the base class for all *enum* enumerations."
@@ -602,6 +613,9 @@ msgid ""
602
613
"quadratic performance impact during creation relative to the total number of "
603
614
"mutable/unhashable values in the enum."
604
615
msgstr ""
616
+ "雖然可以使用可變的 (mutable) / 不可雜湊的 (unhashable) 值,例如 :class:"
617
+ "`dict`、:class:`list` 或可變的 :class:`~dataclasses.dataclass`,它們在建立期"
618
+ "間會對效能產生相對於列舉中可變的 / 不可雜湊的值的總數量的二次方的影響。"
605
619
606
620
#: ../../library/enum.rst:298
607
621
msgid "Name of the member."
@@ -806,7 +820,7 @@ msgstr ""
806
820
#: ../../library/enum.rst:408
807
821
msgid ""
808
822
"results in the call ``int('1a', 16)`` and a value of ``26`` for the member."
809
- msgstr ""
823
+ msgstr "會產生呼叫 ``int('1a', 16)`` 而該成員的值為 ``26``。 "
810
824
811
825
#: ../../library/enum.rst:412
812
826
msgid ""
@@ -925,15 +939,14 @@ msgid "Added :ref:`enum-dataclass-support`"
925
939
msgstr "新增 :ref:`enum-dataclass-support`"
926
940
927
941
#: ../../library/enum.rst:471
928
- #, fuzzy
929
942
msgid ""
930
943
"*IntEnum* is the same as :class:`Enum`, but its members are also integers "
931
944
"and can be used anywhere that an integer can be used. If any integer "
932
945
"operation is performed with an *IntEnum* member, the resulting value loses "
933
946
"its enumeration status."
934
947
msgstr ""
935
- "*IntEnum* 和 * Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地 "
936
- "方 。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態 。"
948
+ "*IntEnum* 和 :class:` Enum` 一樣,但其成員同時也是整數而可以被用在任何使用整數 "
949
+ "的地方 。如果 *IntEnum* 成員經過任何整數運算,結果值會失去其列舉狀態 。"
937
950
938
951
#: ../../library/enum.rst:492
939
952
msgid ""
@@ -952,15 +965,14 @@ msgstr ""
952
965
"meth:`~object.__format__` 已經是 :meth:`!int.__format__`。"
953
966
954
967
#: ../../library/enum.rst:502
955
- #, fuzzy
956
968
msgid ""
957
969
"``StrEnum`` is the same as :class:`Enum`, but its members are also strings "
958
970
"and can be used in most of the same places that a string can be used. The "
959
971
"result of any string operation performed on or with a *StrEnum* member is "
960
972
"not part of the enumeration."
961
973
msgstr ""
962
- "* StrEnum* 和 * Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的 "
963
- "地方 。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。"
974
+ "`` StrEnum`` 和 :class:` Enum` 一樣,但其成員同時也是字串而可以被用在幾乎所有使 "
975
+ "用字串的地方 。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。"
964
976
965
977
#: ../../library/enum.rst:508
966
978
msgid ""
@@ -1138,9 +1150,8 @@ msgstr ""
1138
1150
"<Color.RED|GREEN|BLUE: 7>"
1139
1151
1140
1152
#: ../../library/enum.rst:614
1141
- #, fuzzy
1142
1153
msgid "Returns all the flags in *type(self)* that are not in *self*::"
1143
- msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::"
1154
+ msgstr "回傳所有在 *type(self)* 但不在 * self* 裡的旗標: ::"
1144
1155
1145
1156
#: ../../library/enum.rst:616
1146
1157
msgid ""
@@ -1177,13 +1188,12 @@ msgid "The *repr()* of zero-valued flags has changed. It is now::"
1177
1188
msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::"
1178
1189
1179
1190
#: ../../library/enum.rst:641
1180
- #, fuzzy
1181
1191
msgid ""
1182
1192
"``IntFlag`` is the same as :class:`Flag`, but its members are also integers "
1183
1193
"and can be used anywhere that an integer can be used."
1184
1194
msgstr ""
1185
- "* IntFlag* 和 * Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地 "
1186
- "方 。"
1195
+ "`` IntFlag`` 和 :class:` Flag` 一樣,但其成員同時也是整數而可以被用在任何使用整 "
1196
+ "數的地方 。"
1187
1197
1188
1198
#: ../../library/enum.rst:655
1189
1199
msgid ""
@@ -1200,25 +1210,22 @@ msgstr ""
1200
1210
"3"
1201
1211
1202
1212
#: ../../library/enum.rst:661
1203
- #, fuzzy
1204
1213
msgid "If a :class:`Flag` operation is performed with an *IntFlag* member and:"
1205
- msgstr "如果 *IntFlag* 成員經過 * Flag* 操作且:"
1214
+ msgstr "如果 *IntFlag* 成員經過 :class:` Flag` 操作且:"
1206
1215
1207
1216
#: ../../library/enum.rst:663
1208
1217
msgid "the result is a valid *IntFlag*: an *IntFlag* is returned"
1209
1218
msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*"
1210
1219
1211
1220
#: ../../library/enum.rst:664
1212
- #, fuzzy
1213
1221
msgid ""
1214
1222
"the result is not a valid *IntFlag*: the result depends on the :class:"
1215
1223
"`FlagBoundary` setting"
1216
- msgstr "結果不是合法的 *IntFlag*:結果會根據 * FlagBoundary* 的設定"
1224
+ msgstr "結果不是合法的 *IntFlag*:結果會根據 :class:` FlagBoundary` 的設定"
1217
1225
1218
1226
#: ../../library/enum.rst:666
1219
- #, fuzzy
1220
1227
msgid "The :func:`repr` of unnamed zero-valued flags has changed. It is now:"
1221
- msgstr "未命名且值為 0 的旗標的 * repr()* 已改變。現在是: :: "
1228
+ msgstr "未命名且值為 0 的旗標的 :func:` repr` 已改變。現在是:"
1222
1229
1223
1230
#: ../../library/enum.rst:673
1224
1231
msgid ""
@@ -1377,11 +1384,10 @@ msgid ""
1377
1384
msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。"
1378
1385
1379
1386
#: ../../library/enum.rst:762
1380
- #, fuzzy
1381
1387
msgid ""
1382
1388
"``FlagBoundary`` controls how out-of-range values are handled in :class:"
1383
1389
"`Flag` and its subclasses."
1384
- msgstr "* FlagBoundary* 控制在 * Flag* 及其子類別中如何處理範圍外的值。"
1390
+ msgstr "`` FlagBoundary`` 控制在 :class:` Flag` 及其子類別中如何處理範圍外的值。"
1385
1391
1386
1392
#: ../../library/enum.rst:767
1387
1393
msgid ""
@@ -1418,11 +1424,10 @@ msgstr ""
1418
1424
" allowed 0b0 00111"
1419
1425
1420
1426
#: ../../library/enum.rst:785
1421
- #, fuzzy
1422
1427
msgid ""
1423
1428
"Out-of-range values have invalid values removed, leaving a valid :class:"
1424
1429
"`Flag` value::"
1425
- msgstr "範圍外的值會移除非法值 ,留下合法的 * Flag* 值: ::"
1430
+ msgstr "會移除範圍外的值中的非法值 ,留下合法的 :class:` Flag` 值: ::"
1426
1431
1427
1432
#: ../../library/enum.rst:788
1428
1433
msgid ""
@@ -1445,20 +1450,18 @@ msgstr ""
1445
1450
"<ConformFlag.BLUE: 4>"
1446
1451
1447
1452
#: ../../library/enum.rst:799
1448
- #, fuzzy
1449
1453
msgid ""
1450
1454
"Out-of-range values lose their :class:`Flag` membership and revert to :class:"
1451
1455
"`int`."
1452
- msgstr "範圍外的值會失去它們的 * Flag* 成員資格且恢復成 :class:`int`。"
1456
+ msgstr "範圍外的值會失去它們的 :class:` Flag` 成員資格且恢復成 :class:`int`。"
1453
1457
1454
1458
#: ../../library/enum.rst:812
1455
- #, fuzzy
1456
1459
msgid ""
1457
1460
"Out-of-range values are kept, and the :class:`Flag` membership is kept. This "
1458
1461
"is the default for :class:`IntFlag`::"
1459
1462
msgstr ""
1460
- "範圍外的值會被保留,* Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行 "
1461
- "為 : ::"
1463
+ "範圍外的值會被保留,:class:` Flag` 成員資格也會被保留。這是 :class:`IntFlag` "
1464
+ "的預設行為 : ::"
1462
1465
1463
1466
#: ../../library/enum.rst:815
1464
1467
msgid ""
@@ -1482,7 +1485,7 @@ msgstr ""
1482
1485
1483
1486
#: ../../library/enum.rst:829
1484
1487
msgid "Supported ``__dunder__`` names"
1485
- msgstr "支援 ``__dunder__`` 名稱"
1488
+ msgstr "支援的 ``__dunder__`` 名稱"
1486
1489
1487
1490
#: ../../library/enum.rst:831
1488
1491
msgid ""
@@ -1493,31 +1496,30 @@ msgstr ""
1493
1496
"目的對映。只有在類別上可用。"
1494
1497
1495
1498
#: ../../library/enum.rst:834
1496
- #, fuzzy
1497
1499
msgid ""
1498
1500
":meth:`~Enum.__new__`, if specified, must create and return the enum "
1499
1501
"members; it is also a very good idea to set the member's :attr:`!_value_` "
1500
1502
"appropriately. Once all the members are created it is no longer used."
1501
1503
msgstr ""
1502
- "如果指定了 :meth:`~Enum.__new__`,它必須建立並回傳列舉成員;適當地設定成員"
1504
+ ":meth:`~Enum.__new__`,如果有指定 ,它必須建立並回傳列舉成員;適當地設定成員"
1503
1505
"的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用"
1504
1506
"到。"
1505
1507
1506
1508
#: ../../library/enum.rst:840
1507
1509
msgid "Supported ``_sunder_`` names"
1508
- msgstr "支援 ``_sunder_`` 名稱"
1510
+ msgstr "支援的 ``_sunder_`` 名稱"
1509
1511
1510
1512
#: ../../library/enum.rst:842
1511
1513
msgid ""
1512
1514
":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing "
1513
1515
"member."
1514
- msgstr ""
1516
+ msgstr ":meth:`~EnumType._add_alias_` -- 新增一個名稱作為現有成員的別名。 "
1515
1517
1516
1518
#: ../../library/enum.rst:844
1517
1519
msgid ""
1518
1520
":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an "
1519
1521
"existing member."
1520
- msgstr ""
1522
+ msgstr ":meth:`~EnumType._add_value_alias_` -- 新增一個值作為現有成員的別名。 "
1521
1523
1522
1524
#: ../../library/enum.rst:846
1523
1525
msgid ":attr:`~Enum._name_` -- name of the member"
@@ -1559,32 +1561,33 @@ msgstr ""
1559
1561
":meth:`~Enum._generate_next_value_` -- 用來為列舉成員取得合適的值;可以被覆寫"
1560
1562
1561
1563
#: ../../library/enum.rst:860
1562
- #, fuzzy
1563
1564
msgid ""
1564
1565
"For standard :class:`Enum` classes the next value chosen is the highest "
1565
1566
"value seen incremented by one."
1566
1567
msgstr ""
1567
- "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一 。"
1568
+ "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是所看過的最大值加一 。"
1568
1569
1569
1570
#: ../../library/enum.rst:863
1570
- #, fuzzy
1571
1571
msgid ""
1572
1572
"For :class:`Flag` classes the next value chosen will be the next highest "
1573
1573
"power-of-two."
1574
1574
msgstr ""
1575
- "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後"
1576
- "一個看見的值是什麼。"
1575
+ "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方的數字。"
1577
1576
1578
1577
#: ../../library/enum.rst:866
1579
1578
msgid ""
1580
1579
"While ``_sunder_`` names are generally reserved for the further development "
1581
1580
"of the :class:`Enum` class and can not be used, some are explicitly allowed:"
1582
1581
msgstr ""
1582
+ "雖然 ``_sunder_`` 名稱通常保留用於 :class:`Enum` 類別的進一步開發而不能被使"
1583
+ "用,但有些是明確允許的:"
1583
1584
1584
1585
#: ../../library/enum.rst:869
1585
1586
msgid ""
1586
1587
"``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_"
1587
1588
msgstr ""
1589
+ "``_repr_*``(例如 ``_repr_html_``),例如用於 `IPython 的豐富顯示 <IPython’s "
1590
+ "rich display_>`_"
1588
1591
1589
1592
#: ../../library/enum.rst:871
1590
1593
msgid "``_missing_``, ``_order_``, ``_generate_next_value_``"
@@ -1596,14 +1599,13 @@ msgstr "``_ignore_``"
1596
1599
1597
1600
#: ../../library/enum.rst:873
1598
1601
msgid "``_add_alias_``, ``_add_value_alias_``, ``_repr_*``"
1599
- msgstr ""
1602
+ msgstr "``_add_alias_``、``_add_value_alias_``、``_repr_*`` "
1600
1603
1601
1604
#: ../../library/enum.rst:879
1602
1605
msgid "Utilities and Decorators"
1603
1606
msgstr "通用項目與裝飾器"
1604
1607
1605
1608
#: ../../library/enum.rst:883
1606
- #, fuzzy
1607
1609
msgid ""
1608
1610
"*auto* can be used in place of a value. If used, the *Enum* machinery will "
1609
1611
"call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an "
@@ -1613,11 +1615,11 @@ msgid ""
1613
1615
"for :class:`StrEnum` it will be the lower-cased version of the member's "
1614
1616
"name. Care must be taken if mixing *auto()* with manually specified values."
1615
1617
msgstr ""
1616
- "*auto* 可以用來取代給值。如果使用的話,*Enum* 系統會呼叫 * Enum* 的 :meth :"
1617
- "`~Enum._generate_next_value_` 來取得合適的值。對 * Enum* 和 *IntEnum* 來說,合 "
1618
- "適的值是最後一個值加一 ;對 * Flag* 和 *IntFlag* 來說,是第一個比最大值還大的 "
1619
- "2 的次方的數字;對 * StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和 "
1620
- "手動指定值的話要特別注意 。"
1618
+ "*auto* 可以用來取代給值。如果使用的話,*Enum* 系統會呼叫 :class:` Enum` 的 :"
1619
+ "meth: `~Enum._generate_next_value_` 來取得合適的值。對 :class:` Enum` 和 : "
1620
+ "class:`IntEnum` 來說,合適的值是最後一個值加一 ;對 :class:` Flag` 和 :class: "
1621
+ "`IntFlag` 來說,是第一個比最大值還大的 2 的次方的數字;對 :class:` StrEnum` 來 "
1622
+ "說,是成員名稱的小寫版本。如果混用 *auto()* 和手動指定值的話要特別注意 。"
1621
1623
1622
1624
#: ../../library/enum.rst:891
1623
1625
msgid ""
0 commit comments