99msgstr ""
1010"Project-Id-Version : Python 3.14\n "
1111"Report-Msgid-Bugs-To : \n "
12- "POT-Creation-Date : 2026-09-04 00:18+0000 \n "
12+ "POT-Creation-Date : 2026-09-13 20:11+0800 \n "
1313"PO-Revision-Date : 2023-08-31 11:34+0800\n "
1414"Last-Translator : Steven Hsu <hsuhaochun@gmail.com>\n "
1515"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -523,6 +523,11 @@ msgid ""
523523"statements. An older alternative is a sequence of ``if... elif... elif... "
524524"else``."
525525msgstr ""
526+ "一般來說,結構化的 switch 陳述式會在運算式具有特定值或一組值時,執行一個程式"
527+ "碼區塊。從 Python 3.10 開始,可以使用 ``match ... case`` 陳述式來匹配字面值,"
528+ "或命名空間中的常數。更多關於 :keyword:`match` 陳述式的資訊,請參閱\\ :ref:`規"
529+ "格說明 <match>`\\ 和\\ :ref:`教學 <tut-match>`。較舊的替代方案是一連串的 "
530+ "``if... elif... elif... else``。"
526531
527532#: ../../faq/design.rst:270
528533msgid ""
@@ -540,10 +545,12 @@ msgid ""
540545"func = functions[value]\n"
541546"func()"
542547msgstr ""
543- "if key in mydict:\n"
544- " value = mydict[key]\n"
545- "else:\n"
546- " value = mydict[key] = getvalue(key)"
548+ "functions = {'a': function_1,\n"
549+ " 'b': function_2,\n"
550+ " 'c': self.method_1}\n"
551+ "\n"
552+ "func = functions[value]\n"
553+ "func()"
547554
548555#: ../../faq/design.rst:281
549556msgid ""
@@ -588,6 +595,8 @@ msgid ""
588595"Imitating switch with fallthrough, as with C's switch-case-default, is "
589596"possible, much harder, and less needed."
590597msgstr ""
598+ "模仿具有穿透 (fallthrough) 特性的 switch 雖然可行(就像 C 的 switch-case-"
599+ "default 一樣),但實作起來較為困難,實用性也不高。"
591600
592601#: ../../faq/design.rst:302
593602msgid ""
@@ -878,7 +887,7 @@ msgstr ""
878887#: ../../faq/design.rst:448
879888msgid ""
880889"See :ref:`time-complexity` for the costs of the various list operations."
881- msgstr ""
890+ msgstr "各種串列操作的時間複雜度請參閱 :ref:`time-complexity`。 "
882891
883892#: ../../faq/design.rst:454
884893msgid "How are dictionaries implemented in CPython?"
@@ -916,7 +925,7 @@ msgstr ""
916925msgid ""
917926"See :ref:`time-complexity` for the costs of the various dictionary "
918927"operations."
919- msgstr ""
928+ msgstr "各種字典操作的時間複雜度請參閱 :ref:`time-complexity`。 "
920929
921930#: ../../faq/design.rst:473
922931msgid "Why must dictionary keys be immutable?"
@@ -1129,6 +1138,8 @@ msgid ""
11291138"for key in sorted(mydict):\n"
11301139" ... # do whatever with mydict[key]..."
11311140msgstr ""
1141+ "for key in sorted(mydict):\n"
1142+ " ... # do whatever with mydict[key]..."
11321143
11331144#: ../../faq/design.rst:574
11341145msgid "How do you specify and enforce an interface spec in Python?"
@@ -1255,6 +1266,15 @@ msgid ""
12551266" pass\n"
12561267"..."
12571268msgstr ""
1269+ "class label(Exception): pass # 宣告一個標籤\n"
1270+ "\n"
1271+ "try:\n"
1272+ " ...\n"
1273+ " if condition: raise label() # goto 標籤\n"
1274+ " ...\n"
1275+ "except label: # 跳轉目標\n"
1276+ " pass\n"
1277+ "..."
12581278
12591279#: ../../faq/design.rst:640
12601280msgid ""
@@ -1299,7 +1319,7 @@ msgstr ""
12991319
13001320#: ../../faq/design.rst:661
13011321msgid "f = open(\" /mydir/file.txt\" ) # works fine!"
1302- msgstr ""
1322+ msgstr "f = open( \" /mydir/file.txt \" ) # 正常運作! "
13031323
13041324#: ../../faq/design.rst:663
13051325msgid ""
@@ -1312,6 +1332,9 @@ msgid ""
13121332"dir = r\"\\ this\\ is\\ my\\ dos\\ dir\\ \" [:-1]\n"
13131333"dir = \"\\\\ this\\\\ is\\\\ my\\\\ dos\\\\ dir\\\\\" "
13141334msgstr ""
1335+ "dir = r\"\\ this\\ is\\ my\\ dos\\ dir\" \"\\\\\" \n"
1336+ "dir = r\"\\ this\\ is\\ my\\ dos\\ dir\\ \" [:-1]\n"
1337+ "dir = \"\\\\ this\\\\ is\\\\ my\\\\ dos\\\\ dir\\\\\" "
13151338
13161339#: ../../faq/design.rst:671
13171340msgid "Why doesn't Python have a \" with\" statement for attribute assignments?"
@@ -1332,6 +1355,9 @@ msgid ""
13321355" a = 1 # equivalent to obj.a = 1\n"
13331356" total = total + 1 # obj.total = obj.total + 1"
13341357msgstr ""
1358+ "with obj:\n"
1359+ " a = 1 # 等同於 obj.a = 1\n"
1360+ " total = total + 1 # obj.total = obj.total + 1"
13351361
13361362#: ../../faq/design.rst:681
13371363msgid "In Python, such a construct would be ambiguous."
@@ -1527,6 +1553,12 @@ msgid ""
15271553" \" B\" : [6, 7], # last trailing comma is optional but good style\n"
15281554"}"
15291555msgstr ""
1556+ "[1, 2, 3,]\n"
1557+ "('a', 'b', 'c',)\n"
1558+ "d = {\n"
1559+ " \" A\" : [1, 5],\n"
1560+ " \" B\" : [6, 7], # 最尾的逗號是可選的,但符合良好的規範\n"
1561+ "}"
15301562
15311563#: ../../faq/design.rst:775
15321564msgid "There are several reasons to allow this."
0 commit comments