@@ -8,19 +8,20 @@ msgstr ""
8
8
"Project-Id-Version : Python 3.12\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
10
"POT-Creation-Date : 2023-06-27 00:19+0000\n "
11
- "PO-Revision-Date : 2018-05-23 16:14+0000 \n "
12
- "Last-Translator : Adrian Liaw <adrianliaw2000 @gmail.com>\n "
11
+ "PO-Revision-Date : 2023-09-05 14:49+0800 \n "
12
+ "Last-Translator : RockLeon <therockleona @gmail.com>\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
14
"tw)\n "
15
15
"Language : zh_TW\n "
16
16
"MIME-Version : 1.0\n "
17
17
"Content-Type : text/plain; charset=UTF-8\n "
18
18
"Content-Transfer-Encoding : 8bit\n "
19
19
"Plural-Forms : nplurals=1; plural=0;\n "
20
+ "X-Generator : Poedit 3.3.1\n "
20
21
21
22
#: ../../library/typing.rst:3
22
23
msgid ":mod:`typing` --- Support for type hints"
23
- msgstr ""
24
+ msgstr ":mod:`typing` --- 支援型別提示 "
24
25
25
26
#: ../../library/typing.rst:16
26
27
msgid "**Source code:** :source:`Lib/typing.py`"
@@ -32,184 +33,217 @@ msgid ""
32
33
"They can be used by third party tools such as type checkers, IDEs, linters, "
33
34
"etc."
34
35
msgstr ""
36
+ "Python 執行環境不強制要求函式與變數的型別註釋。他們可以被第三方工具使用,如:"
37
+ "型別檢查器、IDE、linter 等。"
35
38
36
39
#: ../../library/typing.rst:26
37
40
msgid ""
38
41
"This module provides runtime support for type hints. For the original "
39
42
"specification of the typing system, see :pep:`484`. For a simplified "
40
43
"introduction to type hints, see :pep:`483`."
41
44
msgstr ""
45
+ "這個模組提供可以支援型別提示的 runtime。關於加註型別系統的原有規格"
46
+ ",請看 :pep:`484`。關於型別提示的簡易介紹,請看 :pep:`483`。"
42
47
43
48
#: ../../library/typing.rst:31
44
49
msgid ""
45
50
"The function below takes and returns a string and is annotated as follows::"
46
- msgstr ""
51
+ msgstr "以下函式接受及回傳都是使用字串,且註解方式如下: :: "
47
52
48
53
#: ../../library/typing.rst:36
49
54
msgid ""
50
55
"In the function ``greeting``, the argument ``name`` is expected to be of "
51
56
"type :class:`str` and the return type :class:`str`. Subtypes are accepted as "
52
57
"arguments."
53
58
msgstr ""
59
+ "在函式 ``greeting`` 當中,引數 ``name`` 的型別應為 :class:`str` 且回傳的型別"
60
+ "也是 :class:`str`。該引數也可以接受其子型別。"
54
61
55
62
#: ../../library/typing.rst:40
56
63
msgid ""
57
64
"New features are frequently added to the ``typing`` module. The "
58
65
"`typing_extensions <https://pypi.org/project/typing-extensions/>`_ package "
59
66
"provides backports of these new features to older versions of Python."
60
67
msgstr ""
68
+ "新功能會頻繁的新增至 ``typing`` 模組中。`typing_extensions <https://pypi.org/"
69
+ "project/typing-extensions/>`_ 套件為這些新功能提供了 backport(向後移植的)版"
70
+ "本,提供給舊版本的 Python 使用。"
61
71
62
72
#: ../../library/typing.rst:44
63
73
msgid ""
64
74
"For a summary of deprecated features and a deprecation timeline, please see "
65
75
"`Deprecation Timeline of Major Features`_."
66
76
msgstr ""
77
+ "棄用功能及其棄用時間線的簡介,請看\\ `Deprecation Timeline of Major "
78
+ "Features`_ \\ 。"
67
79
68
80
#: ../../library/typing.rst:50
69
81
msgid ""
70
82
"`\" Typing cheat sheet\" <https://mypy.readthedocs.io/en/stable/"
71
83
"cheat_sheet_py3.html>`_"
72
84
msgstr ""
85
+ "`\" 型別小抄 (Typing cheat sheet)\" <https://mypy.readthedocs.io/en/stable/"
86
+ "cheat_sheet_py3.html>`_"
73
87
74
88
#: ../../library/typing.rst:50
75
89
msgid "A quick overview of type hints (hosted at the mypy docs)"
76
- msgstr ""
90
+ msgstr "型別提示的快速預覽(發布於 mypy 的文件中) "
77
91
78
92
#: ../../library/typing.rst:55
79
93
msgid ""
80
94
"\" Type System Reference\" section of `the mypy docs <https://mypy."
81
95
"readthedocs.io/en/stable/index.html>`_"
82
96
msgstr ""
97
+ "`mypy 文件 <https://mypy.readthedocs.io/en/stable/index.html>`_\\ 的 \" 型別系"
98
+ "統參考資料 (Type System Reference)\" 章節"
83
99
84
100
#: ../../library/typing.rst:53
85
101
msgid ""
86
102
"The Python typing system is standardised via PEPs, so this reference should "
87
103
"broadly apply to most Python type checkers. (Some parts may still be "
88
104
"specific to mypy.)"
89
105
msgstr ""
106
+ "Python 的加註型別系統是基於 PEPs 進行標準化,所以這個參照 (reference) "
107
+ "應該在多數 Python 型別檢查器中廣為使用。(某些部分依然是特定給 mypy 使用。)"
90
108
91
109
#: ../../library/typing.rst:59
92
110
msgid ""
93
111
"`\" Static Typing with Python\" <https://typing.readthedocs.io/en/latest/>`_"
94
112
msgstr ""
113
+ "`\" Python 的靜態型別 (Static Typing)\" <https://typing.readthedocs.io/en/"
114
+ "latest/>`_"
95
115
96
116
#: ../../library/typing.rst:58
97
117
msgid ""
98
118
"Type-checker-agnostic documentation written by the community detailing type "
99
119
"system features, useful typing related tools and typing best practices."
100
120
msgstr ""
121
+ "由社群編寫的跨平台型別檢查器文件 (type-checker-agnostic) 詳細描述加註型別系統"
122
+ "的功能、實用的加註型別衍伸工具、以及加註型別的最佳實踐 (best practice)。"
101
123
102
124
#: ../../library/typing.rst:65
103
125
msgid "Relevant PEPs"
104
- msgstr ""
126
+ msgstr "相關的 PEPs "
105
127
106
128
#: ../../library/typing.rst:67
107
129
msgid ""
108
130
"Since the initial introduction of type hints in :pep:`484` and :pep:`483`, a "
109
131
"number of PEPs have modified and enhanced Python's framework for type "
110
132
"annotations:"
111
133
msgstr ""
134
+ "自從 :pep:`484` 及 :pep:`483` 對於型別提示的基礎引入,多個 PEPs 針對型別註釋"
135
+ "的 Python 框架進行修訂及加強:"
112
136
113
137
#: ../../library/typing.rst:77
114
138
msgid ":pep:`526`: Syntax for Variable Annotations"
115
- msgstr ""
139
+ msgstr ":pep:`526`:變數註釋的語法 "
116
140
117
141
#: ../../library/typing.rst:77
118
142
msgid ""
119
143
"*Introducing* syntax for annotating variables outside of function "
120
144
"definitions, and :data:`ClassVar`"
121
- msgstr ""
145
+ msgstr "*引入* \\ 在定義函式之外的變數註釋語法,以及 :data:`ClassVar` "
122
146
123
147
#: ../../library/typing.rst:80
124
148
msgid ":pep:`544`: Protocols: Structural subtyping (static duck typing)"
125
149
msgstr ""
150
+ ":pep:`544`: 協定:建構式子型別 (Structural Subtyping) (靜態鴨子型別,"
151
+ "Static Duck Typing)"
126
152
127
153
#: ../../library/typing.rst:80
128
154
msgid ""
129
155
"*Introducing* :class:`Protocol` and the :func:"
130
156
"`@runtime_checkable<runtime_checkable>` decorator"
131
157
msgstr ""
158
+ "*引入* :class:`Protocol` 以及 :func:`@runtime_checkable<runtime_checkable>` "
159
+ "裝飾器 (decorator)"
132
160
133
161
#: ../../library/typing.rst:83
134
162
msgid ":pep:`585`: Type Hinting Generics In Standard Collections"
135
163
msgstr ""
164
+ ":pep:`585`:基礎彙集 (collection) 中的型別提示泛型 (Type Hinting Generics In "
165
+ "Standard Collections)"
136
166
137
167
#: ../../library/typing.rst:83
138
168
msgid ""
139
169
"*Introducing* :class:`types.GenericAlias` and the ability to use standard "
140
170
"library classes as :ref:`generic types<types-genericalias>`"
141
171
msgstr ""
172
+ "*引入* :class:`types.GenericAlias` 以及使用基礎函式庫類別 :ref:`generic "
173
+ "types<types-genericalias>` 的能力"
142
174
143
175
#: ../../library/typing.rst:85
144
176
msgid ":pep:`586`: Literal Types"
145
- msgstr ""
177
+ msgstr ":pep:`586`:文字型別 "
146
178
147
179
#: ../../library/typing.rst:86
148
180
msgid "*Introducing* :data:`Literal`"
149
- msgstr ""
181
+ msgstr "*引入* :data:`Literal` "
150
182
151
183
#: ../../library/typing.rst:87
152
184
msgid ""
153
185
":pep:`589`: TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys"
154
- msgstr ""
186
+ msgstr ":pep:`589`:TypedDict:含有一組固定 (fixed) 鍵值的型別提示字典 "
155
187
156
188
#: ../../library/typing.rst:88
157
189
msgid "*Introducing* :class:`TypedDict`"
158
- msgstr ""
190
+ msgstr "*引入* :class:`TypedDict` "
159
191
160
192
#: ../../library/typing.rst:89
161
193
msgid ":pep:`591`: Adding a final qualifier to typing"
162
- msgstr ""
194
+ msgstr ":pep:`591`:為型別新增一個最終限定符 (final qualifier) "
163
195
164
196
#: ../../library/typing.rst:90
165
197
msgid "*Introducing* :data:`Final` and the :func:`@final<final>` decorator"
166
- msgstr ""
198
+ msgstr "*引入* :data:`Final` 以及 :func:`@final<final>` 裝飾器 "
167
199
168
200
#: ../../library/typing.rst:91
169
201
msgid ":pep:`593`: Flexible function and variable annotations"
170
- msgstr ""
202
+ msgstr ":pep:`593`:彈性函式及變數註釋 "
171
203
172
204
#: ../../library/typing.rst:92
173
205
msgid "*Introducing* :data:`Annotated`"
174
- msgstr ""
206
+ msgstr "*引入* :data:`Annotated` "
175
207
176
208
#: ../../library/typing.rst:95
177
209
msgid ":pep:`604`: Allow writing union types as ``X | Y``"
178
- msgstr ""
210
+ msgstr ":pep:`604`:允許寫入聯集型別 (union type) 為 ``X | Y`` "
179
211
180
212
#: ../../library/typing.rst:94
181
213
msgid ""
182
214
"*Introducing* :data:`types.UnionType` and the ability to use the binary-or "
183
215
"operator ``|`` to signify a :ref:`union of types<types-union>`"
184
216
msgstr ""
217
+ "*引入* :data:`types.UnionType` 以及使用 binary-or 運算子 ``|`` 以表示\\ :ref:"
218
+ "`型別聯合 <types-union>`\\ 的能力"
185
219
186
220
#: ../../library/typing.rst:97
187
221
msgid ":pep:`612`: Parameter Specification Variables"
188
- msgstr ""
222
+ msgstr ":pep:`612`:參數規格變數 (Parameter Specification Variable) "
189
223
190
224
#: ../../library/typing.rst:98
191
225
msgid "*Introducing* :class:`ParamSpec` and :data:`Concatenate`"
192
- msgstr ""
226
+ msgstr "*引入* :class:`ParamSpec` 及 :data:`Concatenate` "
193
227
194
228
#: ../../library/typing.rst:99
195
229
msgid ":pep:`613`: Explicit Type Aliases"
196
- msgstr ""
230
+ msgstr ":pep:`613`:顯式型別別名 (Explicit Type Alias) "
197
231
198
232
#: ../../library/typing.rst:100
199
233
msgid "*Introducing* :data:`TypeAlias`"
200
234
msgstr "*引入* :data:`TypeAlias`"
201
235
202
236
#: ../../library/typing.rst:101
203
237
msgid ":pep:`646`: Variadic Generics"
204
- msgstr ""
238
+ msgstr ":pep:`646`:可變參數泛型 (Variadic Generic) "
205
239
206
240
#: ../../library/typing.rst:102
207
241
msgid "*Introducing* :data:`TypeVarTuple`"
208
242
msgstr "*引入* :data:`TypeVarTuple`"
209
243
210
244
#: ../../library/typing.rst:103
211
245
msgid ":pep:`647`: User-Defined Type Guards"
212
- msgstr ""
246
+ msgstr ":pep:`647`:使用者定義的型別防護 (Type Guard) "
213
247
214
248
#: ../../library/typing.rst:104
215
249
msgid "*Introducing* :data:`TypeGuard`"
@@ -219,31 +253,31 @@ msgstr "*引入* :data:`TypeGuard`"
219
253
msgid ""
220
254
":pep:`655`: Marking individual TypedDict items as required or potentially "
221
255
"missing"
222
- msgstr ""
256
+ msgstr ":pep:`655`:標記個別的 TypedDict 物件為必需的或可能遺失的 "
223
257
224
258
#: ../../library/typing.rst:106
225
259
msgid "*Introducing* :data:`Required` and :data:`NotRequired`"
226
260
msgstr "*引入* :data:`Required` 和 :data:`NotRequired`"
227
261
228
262
#: ../../library/typing.rst:107
229
263
msgid ":pep:`673`: Self type"
230
- msgstr ""
264
+ msgstr ":pep:`673`:Self 型別 "
231
265
232
266
#: ../../library/typing.rst:108
233
267
msgid "*Introducing* :data:`Self`"
234
268
msgstr "*引入* :data:`Self`"
235
269
236
270
#: ../../library/typing.rst:109
237
271
msgid ":pep:`675`: Arbitrary Literal String Type"
238
- msgstr ""
272
+ msgstr ":pep:`675`:任意的文本字串型別 (Arbitrary Literal String Type) "
239
273
240
274
#: ../../library/typing.rst:110
241
275
msgid "*Introducing* :data:`LiteralString`"
242
276
msgstr "*引入* :data:`LiteralString`"
243
277
244
278
#: ../../library/typing.rst:111
245
279
msgid ":pep:`681`: Data Class Transforms"
246
- msgstr ""
280
+ msgstr ":pep:`681`:資料類別轉換 "
247
281
248
282
#: ../../library/typing.rst:112
249
283
msgid ""
@@ -252,60 +286,70 @@ msgstr "*引入* :func:`@dataclass_transform<dataclass_transform>` 裝飾器"
252
286
253
287
#: ../../library/typing.rst:114
254
288
msgid ":pep:`692`: Using ``TypedDict`` for more precise ``**kwargs`` typing"
255
- msgstr ""
289
+ msgstr ":pep:`692`:為更精準的 ``**kwargs`` 型別使用 ``TypedDict`` "
256
290
257
291
#: ../../library/typing.rst:114
258
292
msgid ""
259
293
"*Introducing* a new way of typing ``**kwargs`` with :data:`Unpack` and :data:"
260
294
"`TypedDict`"
261
295
msgstr ""
296
+ "*引入* 型別 ``**kwargs`` 的新方式 :data:`Unpack` 以及 :data:`TypedDict`"
262
297
263
298
#: ../../library/typing.rst:116
264
299
msgid ":pep:`695`: Type Parameter Syntax"
265
- msgstr ""
300
+ msgstr ":pep:`695`:型別參數語法 "
266
301
267
302
#: ../../library/typing.rst:117
268
303
msgid ""
269
304
"*Introducing* builtin syntax for creating generic functions, classes, and "
270
305
"type aliases."
271
- msgstr ""
306
+ msgstr "*引入* \\ 建立泛型函式、類別、型別別名的內建語法。 "
272
307
273
308
#: ../../library/typing.rst:119
274
309
msgid ":pep:`698`: Adding an override decorator to typing"
275
- msgstr ""
310
+ msgstr ":pep:`698`:為型別新增可覆寫的裝飾器 "
276
311
277
312
#: ../../library/typing.rst:119
278
313
msgid "*Introducing* the :func:`@override<override>` decorator"
279
314
msgstr "*引入* :func:`@override<override>` 裝飾器"
280
315
281
316
#: ../../library/typing.rst:129
282
317
msgid "Type aliases"
283
- msgstr ""
318
+ msgstr "型別別名 "
284
319
285
320
#: ../../library/typing.rst:131
286
321
msgid ""
287
322
"A type alias is defined using the :keyword:`type` statement, which creates "
288
323
"an instance of :class:`TypeAliasType`. In this example, ``Vector`` and "
289
324
"``list[float]`` will be treated equivalently by static type checkers::"
290
325
msgstr ""
326
+ "一個型別別名被定義來使用 :keyword:`type` 陳述式,其建立了 :class:"
327
+ "`TypeAliasType` 的實例。在這個範例中,``Vector`` 及 ``list[float]`` 會被當作"
328
+ "和靜態型別檢查器一樣同等對待: ::"
291
329
292
330
#: ../../library/typing.rst:144
293
331
msgid ""
294
332
"Type aliases are useful for simplifying complex type signatures. For "
295
333
"example::"
296
334
msgstr ""
335
+ "型別別名對於簡化複雜的型別簽名 (complex type signature) 非常好用。舉例來"
336
+ "說: ::"
297
337
298
338
#: ../../library/typing.rst:162
299
339
msgid ""
300
340
"The :keyword:`type` statement is new in Python 3.12. For backwards "
301
341
"compatibility, type aliases can also be created through simple assignment::"
302
342
msgstr ""
343
+ ":keyword:`type` 陳述式是 Python 3.12 的新功能。為了向後相容性,型別別名可以透"
344
+ "過簡單的賦值來建立: ::"
303
345
304
346
#: ../../library/typing.rst:167
305
347
msgid ""
306
348
"Or marked with :data:`TypeAlias` to make it explicit that this is a type "
307
349
"alias, not a normal variable assignment::"
308
350
msgstr ""
351
+ "或是用 :data:`TypeAlias` 標記,讓它明確的表示這是一個型別別名,而非一般的變數"
352
+ "賦值: ::"
309
353
310
354
#: ../../library/typing.rst:177
311
355
msgid "NewType"
@@ -407,9 +451,9 @@ msgstr ""
407
451
408
452
#: ../../library/typing.rst:254 ../../library/typing.rst:2679
409
453
msgid "For example:"
410
- msgstr "舉例來說"
454
+ msgstr "舉例來說: "
411
455
412
- #: ../../library/typing.rst:272
456
+ #: ../../library/typing.rst:272 ../../library/typing.rst:995
413
457
msgid ""
414
458
"The subscription syntax must always be used with exactly two values: the "
415
459
"argument list and the return type. The argument list must be a list of "
@@ -992,14 +1036,6 @@ msgid ""
992
1036
"of type :class:`int` and returns a :class:`str`."
993
1037
msgstr ""
994
1038
995
- #: ../../library/typing.rst:995
996
- msgid ""
997
- "The subscription syntax must always be used with exactly two values: the "
998
- "argument list and the return type. The argument list must be a list of "
999
- "types, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return "
1000
- "type must be a single type."
1001
- msgstr ""
1002
-
1003
1039
#: ../../library/typing.rst:1000
1004
1040
msgid ""
1005
1041
"There is no syntax to indicate optional or keyword arguments; such function "
0 commit comments