@@ -7,7 +7,7 @@ msgstr ""
7
7
"Project-Id-Version : Python 3.12\n "
8
8
"Report-Msgid-Bugs-To : \n "
9
9
"POT-Creation-Date : 2024-06-03 00:03+0000\n "
10
- "PO-Revision-Date : 2024-03-26 11:30 +0800\n "
10
+ "PO-Revision-Date : 2024-07-11 11:12 +0800\n "
11
11
"Last-Translator : Li-Hung Wang <therockleona@gmail.com>\n "
12
12
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
13
13
"tw)\n "
@@ -16,7 +16,7 @@ msgstr ""
16
16
"Content-Type : text/plain; charset=UTF-8\n "
17
17
"Content-Transfer-Encoding : 8bit\n "
18
18
"Plural-Forms : nplurals=1; plural=0;\n "
19
- "X-Generator : Poedit 3.4\n "
19
+ "X-Generator : Poedit 3.4.4 \n "
20
20
21
21
#: ../../library/typing.rst:3
22
22
msgid ":mod:`typing` --- Support for type hints"
@@ -41,7 +41,7 @@ msgstr "此模組提供 runtime 型別提示支援。"
41
41
42
42
#: ../../library/typing.rst:28
43
43
msgid "Consider the function below::"
44
- msgstr ""
44
+ msgstr "動腦筋思考下面的函式: :: "
45
45
46
46
#: ../../library/typing.rst:33
47
47
msgid ""
@@ -50,13 +50,18 @@ msgid ""
50
50
"The function is expected to return an instance of :class:`str`, as indicated "
51
51
"by the ``-> str`` hint."
52
52
msgstr ""
53
+ "函式 ``moon_weight`` 需要一個引數且預期是一個 :class:`float` 的實例,如 "
54
+ "``earth_weight: float`` 所指出的\\ *型別提示*。這個函式預期會回傳一個 :class:"
55
+ "`str` 的實例,如 ``-> str`` 所指出的提示。"
53
56
54
57
#: ../../library/typing.rst:37
55
58
msgid ""
56
59
"While type hints can be simple classes like :class:`float` or :class:`str`, "
57
60
"they can also be more complex. The :mod:`typing` module provides a "
58
61
"vocabulary of more advanced type hints."
59
62
msgstr ""
63
+ "儘管型別提示可以是簡單類別,像是 :class:`float` 或 :class:`str`,他們也可以變"
64
+ "得更為複雜。模組 :mod:`typing` 提供一組更高階的型別提示詞彙。"
60
65
61
66
#: ../../library/typing.rst:41
62
67
msgid ""
@@ -113,14 +118,17 @@ msgstr ""
113
118
114
119
#: ../../library/typing.rst:63
115
120
msgid "Specification for the Python Type System"
116
- msgstr ""
121
+ msgstr "Python 型別系統的技術規範 "
117
122
118
123
#: ../../library/typing.rst:65
119
124
msgid ""
120
125
"The canonical, up-to-date specification of the Python type system can be "
121
126
"found at `\" Specification for the Python type system\" <https://typing."
122
127
"readthedocs.io/en/latest/spec/index.html>`_."
123
128
msgstr ""
129
+ "關於 Python 型別系統標準的 (canonical)、最新的技術規範可以在\\ `「Python 型別"
130
+ "系統的技術規範」 <https://typing.readthedocs.io/en/latest/spec/index."
131
+ "html>`_\\ 找到。"
124
132
125
133
#: ../../library/typing.rst:71
126
134
msgid "Type aliases"
@@ -885,14 +893,16 @@ msgid ""
885
893
":data:`!Never` and :data:`!NoReturn` have the same meaning in the type "
886
894
"system and static type checkers treat both equivalently."
887
895
msgstr ""
896
+ ":data:`!Never` 以及 :data:`!NoReturn` 在型別系統中具有相同的意義且靜態型別檢"
897
+ "查器會將兩者視為相等。"
888
898
889
899
#: ../../library/typing.rst:883
890
900
msgid "Added :data:`NoReturn`."
891
- msgstr ""
901
+ msgstr "新增 :data:`NoReturn`。 "
892
902
893
903
#: ../../library/typing.rst:887
894
904
msgid "Added :data:`Never`."
895
- msgstr ""
905
+ msgstr "新增 :data:`Never`。 "
896
906
897
907
#: ../../library/typing.rst:891
898
908
msgid "Special type to represent the current enclosed class."
@@ -983,67 +993,73 @@ msgstr ""
983
993
984
994
#: ../../library/typing.rst:991
985
995
msgid "Special forms"
986
- msgstr ""
996
+ msgstr "特別型式 "
987
997
988
998
#: ../../library/typing.rst:993
989
999
msgid ""
990
1000
"These can be used as types in annotations. They all support subscription "
991
1001
"using ``[]``, but each has a unique syntax."
992
1002
msgstr ""
1003
+ "這些在註釋中可以當作型別使用。他們全都支援 ``[]`` 的下標使用,但每個都具有獨"
1004
+ "特的語法。"
993
1005
994
1006
#: ../../library/typing.rst:998
995
1007
msgid ""
996
1008
"Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or "
997
1009
"Y."
998
1010
msgstr ""
1011
+ "聯集型別;``Union[X, Y]`` 與 ``X | Y`` 是相等的,且都意味著 X 或 Y 兩者其一。"
999
1012
1000
1013
#: ../../library/typing.rst:1000
1001
1014
msgid ""
1002
1015
"To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | "
1003
1016
"str``. Using that shorthand is recommended. Details:"
1004
1017
msgstr ""
1018
+ "為了定義聯集,例如可以使用 ``Union[int, str]`` 或是使用簡寫 (shorthand) "
1019
+ "``int | str``。使用這種簡寫是非常推薦的。詳細請看: ::"
1005
1020
1006
1021
#: ../../library/typing.rst:1002
1007
1022
msgid "The arguments must be types and there must be at least one."
1008
- msgstr ""
1023
+ msgstr "引數必須為型別且必須有至少一個。 "
1009
1024
1010
1025
#: ../../library/typing.rst:1004
1011
1026
msgid "Unions of unions are flattened, e.g.::"
1012
- msgstr ""
1027
+ msgstr "聯集中的聯集會是扁平化的 (flattened),舉例來說: :: "
1013
1028
1014
1029
#: ../../library/typing.rst:1008
1015
1030
msgid "Unions of a single argument vanish, e.g.::"
1016
- msgstr ""
1031
+ msgstr "單一引數的聯集會消失不見,舉例來說: :: "
1017
1032
1018
1033
#: ../../library/typing.rst:1012
1019
1034
msgid "Redundant arguments are skipped, e.g.::"
1020
- msgstr ""
1035
+ msgstr "多餘的引數會被略過,舉例來說: :: "
1021
1036
1022
1037
#: ../../library/typing.rst:1016
1023
1038
msgid "When comparing unions, the argument order is ignored, e.g.::"
1024
- msgstr ""
1039
+ msgstr "當比較聯集時,引數的順序會被忽略,舉例來說: :: "
1025
1040
1026
1041
#: ../../library/typing.rst:1020
1027
1042
msgid "You cannot subclass or instantiate a ``Union``."
1028
- msgstr ""
1043
+ msgstr "你不能建立 ``Union`` 的子類別或是實例。 "
1029
1044
1030
1045
#: ../../library/typing.rst:1022
1031
1046
msgid "You cannot write ``Union[X][Y]``."
1032
1047
msgstr "你不能寫成 ``Union[X][Y]``。"
1033
1048
1034
1049
#: ../../library/typing.rst:1024
1035
1050
msgid "Don't remove explicit subclasses from unions at runtime."
1036
- msgstr ""
1051
+ msgstr "請勿在 runtime 中將顯性子類別從聯集中移除。 "
1037
1052
1038
1053
#: ../../library/typing.rst:1027
1039
1054
msgid ""
1040
1055
"Unions can now be written as ``X | Y``. See :ref:`union type "
1041
1056
"expressions<types-union>`."
1042
1057
msgstr ""
1058
+ "現在可以將聯集寫成 ``X | Y``。請見\\ :ref:`聯集型別運算式 <types-union>`。"
1043
1059
1044
1060
#: ../../library/typing.rst:1033
1045
1061
msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)."
1046
- msgstr ""
1062
+ msgstr "``Optional[X]`` 與 ``X | None`` 是相等的(或是 ``Union[X, None]``)。 "
1047
1063
1048
1064
#: ../../library/typing.rst:1035
1049
1065
msgid ""
@@ -1052,23 +1068,30 @@ msgid ""
1052
1068
"the ``Optional`` qualifier on its type annotation just because it is "
1053
1069
"optional. For example::"
1054
1070
msgstr ""
1071
+ "請注意,這與具有預設值的選擇性引數 (optional argument) 不是相同的概念。一個具"
1072
+ "有預設值的選擇性引數的型別註釋中不具有 ``Optional`` 限定符 (qualifier),單純"
1073
+ "的因為它就是選擇性的。舉例來說: ::"
1055
1074
1056
1075
#: ../../library/typing.rst:1043
1057
1076
msgid ""
1058
1077
"On the other hand, if an explicit value of ``None`` is allowed, the use of "
1059
1078
"``Optional`` is appropriate, whether the argument is optional or not. For "
1060
1079
"example::"
1061
1080
msgstr ""
1081
+ "另一方面,如果一個顯性的值 ``None`` 是被允許的,不論引數是不是選擇性的,"
1082
+ "``Optional`` 都適用。舉例來說: ::"
1062
1083
1063
1084
#: ../../library/typing.rst:1050
1064
1085
msgid ""
1065
1086
"Optional can now be written as ``X | None``. See :ref:`union type "
1066
1087
"expressions<types-union>`."
1067
1088
msgstr ""
1089
+ "現在可以將 Optional 寫成 ``X | None``。請見\\ :ref:`聯集型別運算式 <types-"
1090
+ "union>`。"
1068
1091
1069
1092
#: ../../library/typing.rst:1056
1070
1093
msgid "Special form for annotating higher-order functions."
1071
- msgstr ""
1094
+ msgstr "用於註釋高階函式的特別型式。 "
1072
1095
1073
1096
#: ../../library/typing.rst:1058
1074
1097
msgid ""
@@ -1080,6 +1103,13 @@ msgid ""
1080
1103
"a :ref:`Callable <annotating-callables>`. The last parameter to "
1081
1104
"``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)."
1082
1105
msgstr ""
1106
+ "``Concatenate`` 可以被用在\\ :ref:`可呼叫物件 <annotating-callables>`\\ 與 :"
1107
+ "class:`ParamSpec` 的接合 (conjunction) 並註釋一個高階的 Callable 物件可以新"
1108
+ "增、移除、轉換另一個 Callable 物件的參數。使用方法是依照這個格式 "
1109
+ "``Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]``。``Concatenate`` "
1110
+ "目前只在 :ref:`Callable 物件 <annotating-callables>`\\ 中第一個引數使用時有"
1111
+ "效。``Concatenate`` 的最後一個參數必須為一個 :class:`ParamSpec` 或是刪節號 "
1112
+ "(``...``)。"
1083
1113
1084
1114
#: ../../library/typing.rst:1067
1085
1115
msgid ""
@@ -1091,12 +1121,17 @@ msgid ""
1091
1121
"parameter types are dependent on the parameter types of the callable being "
1092
1122
"passed in::"
1093
1123
msgstr ""
1124
+ "舉例來說,註釋一個為裝飾過後的函式提供 :class:`threading.Lock` 的裝飾器 "
1125
+ "``with_lock``,``Concatenate`` 可以用於指出 ``with_lock`` 預期一個 Callable "
1126
+ "物件,該物件可以接受 ``Lock`` 作為第一引數,並回傳一個具有不同型別簽名 "
1127
+ "Callable 物件。在這種情況下,:class:`ParamSpec` 指出回傳的 Callable 物件的參"
1128
+ "數型別會依賴傳遞的 Callable 物件的參數型別: ::"
1094
1129
1095
1130
#: ../../library/typing.rst:1103 ../../library/typing.rst:1865
1096
1131
msgid ""
1097
1132
":pep:`612` -- Parameter Specification Variables (the PEP which introduced "
1098
1133
"``ParamSpec`` and ``Concatenate``)"
1099
- msgstr ""
1134
+ msgstr ":pep:`612` -- 參數技術規範變數 "
1100
1135
1101
1136
#: ../../library/typing.rst:1105
1102
1137
msgid ":class:`ParamSpec`"
@@ -1108,20 +1143,24 @@ msgstr ":ref:`annotating-callables`"
1108
1143
1109
1144
#: ../../library/typing.rst:1110
1110
1145
msgid "Special typing form to define \" literal types\" ."
1111
- msgstr ""
1146
+ msgstr "特殊型別格式,用於定義「文本型別 (literal type)」。 "
1112
1147
1113
1148
#: ../../library/typing.rst:1112
1114
1149
msgid ""
1115
1150
"``Literal`` can be used to indicate to type checkers that the annotated "
1116
1151
"object has a value equivalent to one of the provided literals."
1117
1152
msgstr ""
1153
+ "``Literal`` 可以用於型別檢查器並指出註釋物件具有一個與提供的文本相同的值。"
1118
1154
1119
1155
#: ../../library/typing.rst:1128
1120
1156
msgid ""
1121
1157
"``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is "
1122
1158
"allowed as type argument to ``Literal[...]``, but type checkers may impose "
1123
1159
"restrictions. See :pep:`586` for more details about literal types."
1124
1160
msgstr ""
1161
+ "``Literal[...]`` 不可以進行子類別化。在 runtime 之中,任意的值是允許作為 "
1162
+ "``Literal[...]`` 的型別引數,但型別檢查器可能會加強限制。更多有關文本型別的詳"
1163
+ "細資訊請看 :pep:`586`。"
1125
1164
1126
1165
#: ../../library/typing.rst:1134
1127
1166
msgid ""
@@ -1130,21 +1169,27 @@ msgid ""
1130
1169
"now raise a :exc:`TypeError` exception during equality comparisons if one of "
1131
1170
"their parameters are not :term:`hashable`."
1132
1171
msgstr ""
1172
+ "``Literal``現在可以刪除重複 (de-deplicate) 的參數。``Literal`` 物件的相等性比"
1173
+ "較不再依照相依性排序。``Literal`` 物件現在會在相等性比較期間,若任一個其中的"
1174
+ "參數無法 :term:`hashable` 時,則會引發一個 :exc:`TypeError` 例外。"
1133
1175
1134
1176
#: ../../library/typing.rst:1142
1135
1177
msgid "Special type construct to mark class variables."
1136
- msgstr ""
1178
+ msgstr "特殊型別建構,用來標記類別變數。 "
1137
1179
1138
1180
#: ../../library/typing.rst:1144
1139
1181
msgid ""
1140
1182
"As introduced in :pep:`526`, a variable annotation wrapped in ClassVar "
1141
1183
"indicates that a given attribute is intended to be used as a class variable "
1142
1184
"and should not be set on instances of that class. Usage::"
1143
1185
msgstr ""
1186
+ "如同在 :pep:`526` 中的介紹,一個變數註解被包裝在 ClassVar 中時,會指出一個給"
1187
+ "定的屬性 (attribute) 意圖被當作類別變數使用,且不該被設定成該類別的實例。使用"
1188
+ "方法如下: ::"
1144
1189
1145
1190
#: ../../library/typing.rst:1152
1146
1191
msgid ":data:`ClassVar` accepts only types and cannot be further subscribed."
1147
- msgstr ""
1192
+ msgstr ":data:`ClassVar` 只接受型別請不得使用下標。 "
1148
1193
1149
1194
#: ../../library/typing.rst:1154
1150
1195
msgid ""
@@ -1153,26 +1198,33 @@ msgid ""
1153
1198
"runtime behavior, but it can be used by third-party type checkers. For "
1154
1199
"example, a type checker might flag the following code as an error::"
1155
1200
msgstr ""
1201
+ ":data:`ClassVar` 並不代表該類別本身,而且不應該和 :func:`isinstance` 或是 :"
1202
+ "func:`issubclass` 一起使用。:data:`ClassVar` 不會改變 Python runtime 的行為,"
1203
+ "但它可以被第三方的型別檢查器使用。舉例來說,一個型別檢查器可能會標記下方的程"
1204
+ "式碼為一個錯誤: ::"
1156
1205
1157
1206
#: ../../library/typing.rst:1168
1158
1207
msgid "Special typing construct to indicate final names to type checkers."
1159
- msgstr ""
1208
+ msgstr "特殊型別建構,用來指出最終名稱給型別檢查器。 "
1160
1209
1161
1210
#: ../../library/typing.rst:1170
1162
1211
msgid ""
1163
1212
"Final names cannot be reassigned in any scope. Final names declared in class "
1164
1213
"scopes cannot be overridden in subclasses."
1165
1214
msgstr ""
1215
+ "最終名稱不可以在任何作用域 (scope) 中重新賦值。在類別作用域中宣告的最終名稱,"
1216
+ "不得在子類別中進行覆寫 (override)。"
1166
1217
1167
1218
#: ../../library/typing.rst:1184 ../../library/typing.rst:2785
1168
1219
msgid ""
1169
1220
"There is no runtime checking of these properties. See :pep:`591` for more "
1170
1221
"details."
1171
1222
msgstr ""
1223
+ "這些屬性 (property) 不會在 runtime 時進行檢查。更多詳細資訊請看 :pep:`591`。"
1172
1224
1173
1225
#: ../../library/typing.rst:1191
1174
1226
msgid "Special typing construct to mark a :class:`TypedDict` key as required."
1175
- msgstr ""
1227
+ msgstr "特殊型別建構,用來標記一個 :class:`TypedDict` 鍵值是必須的。 "
1176
1228
1177
1229
#: ../../library/typing.rst:1193
1178
1230
msgid ""
@@ -1186,7 +1238,7 @@ msgstr ""
1186
1238
msgid ""
1187
1239
"Special typing construct to mark a :class:`TypedDict` key as potentially "
1188
1240
"missing."
1189
- msgstr ""
1241
+ msgstr "特殊型別建構,用來標記一個 :class:`TypedDict` 鍵值是可能消失的。 "
1190
1242
1191
1243
#: ../../library/typing.rst:1203
1192
1244
msgid "See :class:`TypedDict` and :pep:`655` for more details."
0 commit comments