@@ -8,7 +8,7 @@ msgstr ""
8
8
"Project-Id-Version : Python 3.12\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
10
"POT-Creation-Date : 2023-10-11 17:13+0000\n "
11
- "PO-Revision-Date : 2023-11-01 14:02 +0800\n "
11
+ "PO-Revision-Date : 2023-11-03 13:17 +0800\n "
12
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 "
@@ -33,7 +33,7 @@ msgid ""
33
33
"They can be used by third party tools such as type checkers, IDEs, linters, "
34
34
"etc."
35
35
msgstr ""
36
- "Python 執行環境不強制要求函式與變數的型別註釋 。他們可以被第三方工具使用,如:"
36
+ "Python runtime 不強制要求函式與變數的型別註釋 。他們可以被第三方工具使用,如:"
37
37
"型別檢查器、IDE、linter 等。"
38
38
39
39
#: ../../library/typing.rst:26
@@ -357,7 +357,7 @@ msgstr "NewType"
357
357
358
358
#: ../../library/typing.rst:179
359
359
msgid "Use the :class:`NewType` helper to create distinct types::"
360
- msgstr "使用 :class:`NewType` 工具 (helper) 建立獨特型別: ::"
360
+ msgstr "使用 :class:`NewType` 輔助工具 (helper) 建立獨特型別: ::"
361
361
362
362
#: ../../library/typing.rst:186
363
363
msgid ""
@@ -374,9 +374,9 @@ msgid ""
374
374
"pass in a ``UserId`` wherever an ``int`` might be expected, but will prevent "
375
375
"you from accidentally creating a ``UserId`` in an invalid way::"
376
376
msgstr ""
377
- "你依然可以在型別 `UserId`` 的變數中,執行所有 ``int`` 的操作。這讓你可以在預 "
378
- "期是 ``int`` 的情況之下傳遞一個 ``UserId``,這會預防你意外使用無效的方法建立 "
379
- "一個 ``UserId``: ::"
377
+ "你依然可以在型別 `` UserId`` 的變數中執行所有 ``int`` 的操作。這讓你可以在預期 "
378
+ "接受 ``int`` 的地方傳遞一個 ``UserId``,還能預防你意外使用無效的方法建立一個 "
379
+ "``UserId``: ::"
380
380
381
381
#: ../../library/typing.rst:206
382
382
msgid ""
@@ -386,17 +386,17 @@ msgid ""
386
386
"it. That means the expression ``Derived(some_value)`` does not create a new "
387
387
"class or introduce much overhead beyond that of a regular function call."
388
388
msgstr ""
389
- "注意這只會透過靜態型別檢查器強制檢查。在執行環境 ( runtime) 中,敘述句 "
390
- "(statement) ``Derived = NewType('Derived', Base)`` 會使 ``Derived`` 成為一個 "
391
- "callable(可呼叫物件 ),會立即回傳任何你傳遞的引數。這意味著 expression (運 "
392
- "算式) ``Derived(some_value)`` 不會建立一個新的類別或過度引入原有的涵式呼叫 。"
389
+ "注意這只會透過靜態型別檢查器強制檢查。在 runtime 中,陳述式 (statement) "
390
+ "``Derived = NewType('Derived', Base)`` 會使 ``Derived`` 成為一個 callable(可 "
391
+ "呼叫物件 ),會立即回傳任何你傳遞的引數。這意味著 expression (運算式) "
392
+ "``Derived(some_value)`` 不會建立一個新的類別或過度引入原有的函式呼叫 。"
393
393
394
394
#: ../../library/typing.rst:212
395
395
msgid ""
396
396
"More precisely, the expression ``some_value is Derived(some_value)`` is "
397
397
"always true at runtime."
398
398
msgstr ""
399
- "更精確地說,expression ``some_value is Derived(some_value)`` 在執行環境時永遠 "
399
+ "更精確地說,expression ``some_value is Derived(some_value)`` 在 runtime 永遠 "
400
400
"為 true。"
401
401
402
402
#: ../../library/typing.rst:215
@@ -408,7 +408,7 @@ msgid ""
408
408
"However, it is possible to create a :class:`NewType` based on a 'derived' "
409
409
"``NewType``::"
410
410
msgstr ""
411
- "無論如何,這有辦法基於 'derived ' ``NewType`` 建立一個 :class:`NewType`: ::"
411
+ "無論如何,這有辦法基於 '衍生的 ' ``NewType`` 建立一個 :class:`NewType`: ::"
412
412
413
413
#: ../../library/typing.rst:232
414
414
msgid "and typechecking for ``ProUserId`` will work as expected."
@@ -441,8 +441,8 @@ msgstr ""
441
441
"相反的,``NewType`` 宣告一個型別會是另外一種型別的子類別。使用 ``Derived = "
442
442
"NewType('Derived', Original)`` 會使靜態型別檢查器將 ``Derived`` 視為 "
443
443
"``Original`` 的子類別,也意味著一個型別為 ``Original`` 的值,不能被使用在任何"
444
- "預期接收到型別 ``Derived`` 的值的區域。這當你想用最小的執行環境成本 ( runtime "
445
- "cost) 預防邏輯性錯誤而言 ,非常有用。"
444
+ "預期接收到型別 ``Derived`` 的值的區域。這當你想用最小的 runtime 成本預防邏輯 "
445
+ "性錯誤而言 ,非常有用。"
446
446
447
447
#: ../../library/typing.rst:252
448
448
msgid ""
@@ -451,7 +451,7 @@ msgid ""
451
451
"function."
452
452
msgstr ""
453
453
"現在的 ``NewType`` 比起一個函式更像一個類別。因此,比起一般的函式,呼叫 "
454
- "``NewType`` 需要額外的執行環境成本 。"
454
+ "``NewType`` 需要額外的 runtime 成本 。"
455
455
456
456
#: ../../library/typing.rst:257
457
457
msgid ""
@@ -461,7 +461,7 @@ msgstr "呼叫 ``NewType`` 的效能已經恢復與 Python 3.9 相同的水準
461
461
462
462
#: ../../library/typing.rst:264
463
463
msgid "Annotating callable objects"
464
- msgstr "標記 callable 物件"
464
+ msgstr "註釋 callable 物件"
465
465
466
466
#: ../../library/typing.rst:266
467
467
msgid ""
@@ -470,8 +470,8 @@ msgid ""
470
470
"``Callable[[int], str]`` signifies a function that takes a single parameter "
471
471
"of type :class:`int` and returns a :class:`str`."
472
472
msgstr ""
473
- "函式,或者是 :term:`callable` 物件,可以使用 :class:`collections.abc."
474
- "Callable` 或 :data:`typing.Callable` 進行標記 。 ``Callable[[int], str]`` 象徵"
473
+ "函式,或者是其他 :term:`callable` 物件,可以使用 :class:`collections.abc."
474
+ "Callable` 或 :data:`typing.Callable` 進行註釋 。 ``Callable[[int], str]`` 象徵"
475
475
"為一個函式,可以接受一個型別為 :class:`int` 的引數,並回傳一個 :class:`str`。"
476
476
477
477
#: ../../library/typing.rst:271 ../../library/typing.rst:2888
@@ -486,7 +486,7 @@ msgid ""
486
486
"types, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return "
487
487
"type must be a single type."
488
488
msgstr ""
489
- "使用訂閱語法 (subscription syntax) 時,必須使用到兩個值,分別為引述串列以及回"
489
+ "使用下標語法 (subscription syntax) 時,必須使用到兩個值,分別為引述串列以及回"
490
490
"傳類別。引數串列必須為一個型別串列::class:`ParamSpec`、:data:`Concatenate` "
491
491
"或是一個刪節號 (ellipsis)。回傳類別必為一個單一類別。"
492
492
@@ -495,7 +495,7 @@ msgid ""
495
495
"If a literal ellipsis ``...`` is given as the argument list, it indicates "
496
496
"that a callable with any arbitrary parameter list would be acceptable:"
497
497
msgstr ""
498
- "若刪節號文字 ``...`` 被當作引數串列給定,其指出一個具任何、隨意參數列表的 "
498
+ "若刪節號文字 ``...`` 被當作引數串列給定,其指出一個具任何、任意參數列表的 "
499
499
"callable 會被接受: ::"
500
500
501
501
#: ../../library/typing.rst:306
@@ -507,7 +507,7 @@ msgid ""
507
507
"__call__` method:"
508
508
msgstr ""
509
509
"``Callable`` 不如有可變數量引數的函式、:func:`overloaded functions "
510
- "<overload>`、或是限定關鍵字參數的函式 ,可以表示複雜簽名。然而,這些簽名可以透"
510
+ "<overload>`、或是僅限關鍵字參數的函式 ,可以表示複雜簽名。然而,這些簽名可以透"
511
511
"過定義一個具有 :meth:`~object.__call__` 方法的 :class:`Protocol` 類別進行表"
512
512
"示:"
513
513
@@ -568,15 +568,15 @@ msgstr ""
568
568
569
569
#: ../../library/typing.rst:379
570
570
msgid "Or by using the :class:`TypeVar` factory directly::"
571
- msgstr "或是直接使用 :class:`TypeVar` 工具 (factory): ::"
571
+ msgstr "或是直接使用 :class:`TypeVar` 工廠 (factory): ::"
572
572
573
573
#: ../../library/typing.rst:389
574
574
msgid "Syntactic support for generics is new in Python 3.12."
575
575
msgstr "在 Python 3.12 中,泛型的語法支援是全新功能。"
576
576
577
577
#: ../../library/typing.rst:395
578
578
msgid "Annotating tuples"
579
- msgstr "標記元組 (tuple)"
579
+ msgstr "註釋元組 (tuple)"
580
580
581
581
#: ../../library/typing.rst:397
582
582
msgid ""
@@ -594,9 +594,9 @@ msgid ""
594
594
"the keys, and the second indicates the type of the values."
595
595
msgstr ""
596
596
":class:`list` 只接受一個型別引數,所以型別檢查器可能在上述 ``y`` 賦值 "
597
- "(assignment)觸發錯誤。類似的範例,:class:`~collections.abc.Mapping` 只接受兩"
598
- "個型別引數:第一個引數指出 keys (鍵) 的型別;第二個引數指出 values (值)的 "
599
- "型別 。"
597
+ "(assignment) 觸發錯誤。類似的範例,:class:`~collections.abc.Mapping` 只接受兩"
598
+ "個型別引數:第一個引數指出 keys(鍵)的型別;第二個引數指出 values(值)的型 "
599
+ "別 。"
600
600
601
601
#: ../../library/typing.rst:418
602
602
msgid ""
@@ -606,7 +606,7 @@ msgid ""
606
606
"`tuple` accepts *any number* of type arguments::"
607
607
msgstr ""
608
608
"然而,與其他多數的 Python 容器不同,在慣用的 (idiomatic) Python 程式碼中,元"
609
- "組可以擁有不完全相同型別的元素是相當常見的。為此,元祖在 Python 的加註型別系"
609
+ "組可以擁有不完全相同型別的元素是相當常見的。為此,元組在 Python 的加註型別系"
610
610
"統中是個特例 (special-cased)。:class:`tuple` 接受\\ *任何數量*\\ 的型別引"
611
611
"數: ::"
612
612
@@ -619,7 +619,7 @@ msgid ""
619
619
msgstr ""
620
620
"為了標示一個元組可以為\\ *任意*\\ 長度,且所有元素皆是相同型別 ``T``,請使用 "
621
621
"``tuple[T, ...]`` 進行標示。為了標示一個空元組,請使用 ``tuple[()]``。單純使"
622
- "用 ``tuple`` 作為標記 ,會與使用 ``tuple[Any, ...]`` 是相等的: ::"
622
+ "用 ``tuple`` 作為註釋 ,會與使用 ``tuple[Any, ...]`` 是相等的: ::"
623
623
624
624
#: ../../library/typing.rst:457
625
625
msgid "The type of class objects"
0 commit comments