|
6 | 6 | msgstr "" |
7 | 7 | "Project-Id-Version: Python 3.14\n" |
8 | 8 | "Report-Msgid-Bugs-To: \n" |
9 | | -"POT-Creation-Date: 2026-05-14 00:37+0000\n" |
| 9 | +"POT-Creation-Date: 2026-05-23 00:37+0000\n" |
10 | 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-" |
@@ -1302,10 +1302,11 @@ msgid "The :data:`Any` type" |
1302 | 1302 | msgstr ":data:`Any` 型別" |
1303 | 1303 |
|
1304 | 1304 | #: ../../library/typing.rst:721 |
| 1305 | +#, fuzzy |
1305 | 1306 | msgid "" |
1306 | 1307 | "A special kind of type is :data:`Any`. A static type checker will treat " |
1307 | | -"every type as being compatible with :data:`Any` and :data:`Any` as being " |
1308 | | -"compatible with every type." |
| 1308 | +"every type as assignable to :data:`Any` and :data:`Any` as assignable to " |
| 1309 | +"every type." |
1309 | 1310 | msgstr "" |
1310 | 1311 | ":data:`Any` 是一種特別的型別。一個靜態型別檢查器會將每個型別視為可相容於 :" |
1311 | 1312 | "data:`Any` 且 :data:`Any` 也可以相容於每個型別。" |
@@ -1413,7 +1414,7 @@ msgid "" |
1413 | 1414 | "hash_a(42)\n" |
1414 | 1415 | "hash_a(\"foo\")\n" |
1415 | 1416 | "\n" |
1416 | | -"# Passes type checking, since Any is compatible with all types\n" |
| 1417 | +"# Passes type checking, since Any is assignable to all types\n" |
1417 | 1418 | "hash_b(42)\n" |
1418 | 1419 | "hash_b(\"foo\")" |
1419 | 1420 | msgstr "" |
@@ -1541,11 +1542,13 @@ msgid "Special type indicating an unconstrained type." |
1541 | 1542 | msgstr "特別型別,指出一個不受約束 (unconstrained) 的型別。" |
1542 | 1543 |
|
1543 | 1544 | #: ../../library/typing.rst:854 |
1544 | | -msgid "Every type is compatible with :data:`Any`." |
| 1545 | +#, fuzzy |
| 1546 | +msgid "Every type is assignable to :data:`Any`." |
1545 | 1547 | msgstr "所有型別皆與 :data:`Any` 相容。" |
1546 | 1548 |
|
1547 | 1549 | #: ../../library/typing.rst:855 |
1548 | | -msgid ":data:`Any` is compatible with every type." |
| 1550 | +#, fuzzy |
| 1551 | +msgid ":data:`Any` is assignable to every type." |
1549 | 1552 | msgstr ":data:`Any` 相容於所有型別。" |
1550 | 1553 |
|
1551 | 1554 | #: ../../library/typing.rst:857 |
@@ -2289,11 +2292,12 @@ msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." |
2289 | 2292 | msgstr ":data:`ClassVar` 只接受型別請不得使用下標。" |
2290 | 2293 |
|
2291 | 2294 | #: ../../library/typing.rst:1295 |
| 2295 | +#, fuzzy |
2292 | 2296 | msgid "" |
2293 | | -":data:`ClassVar` is not a class itself, and should not be used with :func:" |
| 2297 | +":data:`ClassVar` is not a class itself, and cannot be used with :func:" |
2294 | 2298 | "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " |
2295 | | -"runtime behavior, but it can be used by third-party type checkers. For " |
2296 | | -"example, a type checker might flag the following code as an error::" |
| 2299 | +"runtime behavior, but it can be used by static type checkers. For example, a " |
| 2300 | +"type checker might flag the following code as an error::" |
2297 | 2301 | msgstr "" |
2298 | 2302 | ":data:`ClassVar` 並不代表該類別本身,而且不應該和 :func:`isinstance` 或是 :" |
2299 | 2303 | "func:`issubclass` 一起使用。:data:`ClassVar` 不會改變 Python runtime 的行為," |
@@ -2375,14 +2379,15 @@ msgid "" |
2375 | 2379 | msgstr "特殊型別建構,用來標記一個 :class:`TypedDict` 的項目是唯讀的。" |
2376 | 2380 |
|
2377 | 2381 | #: ../../library/typing.rst:1362 |
| 2382 | +#, fuzzy |
2378 | 2383 | msgid "" |
2379 | 2384 | "class Movie(TypedDict):\n" |
2380 | 2385 | " title: ReadOnly[str]\n" |
2381 | 2386 | " year: int\n" |
2382 | 2387 | "\n" |
2383 | 2388 | "def mutate_movie(m: Movie) -> None:\n" |
2384 | 2389 | " m[\"year\"] = 1999 # allowed\n" |
2385 | | -" m[\"title\"] = \"The Matrix\" # typechecker error" |
| 2390 | +" m[\"title\"] = \"The Matrix\" # type checker error" |
2386 | 2391 | msgstr "" |
2387 | 2392 | "class Movie(TypedDict):\n" |
2388 | 2393 | " title: ReadOnly[str]\n" |
@@ -3883,11 +3888,11 @@ msgstr "" |
3883 | 3888 |
|
3884 | 3889 | #: ../../library/typing.rst:2384 |
3885 | 3890 | msgid "" |
3886 | | -"The resulting class has an extra attribute ``__annotations__`` giving a dict " |
3887 | | -"that maps the field names to the field types. (The field names are in the " |
3888 | | -"``_fields`` attribute and the default values are in the ``_field_defaults`` " |
3889 | | -"attribute, both of which are part of the :func:`~collections.namedtuple` " |
3890 | | -"API.)" |
| 3891 | +"The types for each field name can be retrieved by calling :func:" |
| 3892 | +"`annotationlib.get_annotations` on the resulting class. (The field names are " |
| 3893 | +"in the ``_fields`` attribute and the default values are in the " |
| 3894 | +"``_field_defaults`` attribute, both of which are part of the :func:" |
| 3895 | +"`~collections.namedtuple` API.)" |
3891 | 3896 | msgstr "" |
3892 | 3897 |
|
3893 | 3898 | #: ../../library/typing.rst:2390 |
@@ -3996,7 +4001,7 @@ msgstr "" |
3996 | 4001 |
|
3997 | 4002 | #: ../../library/typing.rst:2460 |
3998 | 4003 | msgid "" |
3999 | | -"A ``NewType`` is considered a distinct type by a typechecker. At runtime, " |
| 4004 | +"A ``NewType`` is considered a distinct type by a type checker. At runtime, " |
4000 | 4005 | "however, calling a ``NewType`` returns its argument unchanged." |
4001 | 4006 | msgstr "" |
4002 | 4007 |
|
@@ -4109,7 +4114,7 @@ msgstr "" |
4109 | 4114 | #: ../../library/typing.rst:2534 |
4110 | 4115 | msgid "" |
4111 | 4116 | "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " |
4112 | | -"This allows a simple-minded structural check, very similar to \"one trick " |
| 4117 | +"This allows a simple-minded structural check, very similar to \"one-trick " |
4113 | 4118 | "ponies\" in :mod:`collections.abc` such as :class:`~collections.abc." |
4114 | 4119 | "Iterable`. For example::" |
4115 | 4120 | msgstr "" |
@@ -4439,9 +4444,9 @@ msgstr "" |
4439 | 4444 |
|
4440 | 4445 | #: ../../library/typing.rst:2726 |
4441 | 4446 | msgid "" |
4442 | | -"A ``TypedDict`` can be introspected via annotations dicts (see :ref:" |
4443 | | -"`annotations-howto` for more information on annotations best practices), :" |
4444 | | -"attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." |
| 4447 | +"A ``TypedDict`` can be introspected via :func:`annotationlib." |
| 4448 | +"get_annotations` (see :ref:`annotations-howto` for more information on " |
| 4449 | +"annotations best practices) and the following attributes:" |
4445 | 4450 | msgstr "" |
4446 | 4451 |
|
4447 | 4452 | #: ../../library/typing.rst:2732 |
@@ -4502,8 +4507,8 @@ msgstr "" |
4502 | 4507 | msgid "" |
4503 | 4508 | "For backwards compatibility with Python 3.10 and below, it is also possible " |
4504 | 4509 | "to use inheritance to declare both required and non-required keys in the " |
4505 | | -"same ``TypedDict`` . This is done by declaring a ``TypedDict`` with one " |
4506 | | -"value for the ``total`` argument and then inheriting from it in another " |
| 4510 | +"same ``TypedDict``. This is done by declaring a ``TypedDict`` with one value " |
| 4511 | +"for the ``total`` argument and then inheriting from it in another " |
4507 | 4512 | "``TypedDict`` with a different value for ``total``:" |
4508 | 4513 | msgstr "" |
4509 | 4514 |
|
@@ -4613,33 +4618,38 @@ msgstr "" |
4613 | 4618 |
|
4614 | 4619 | #: ../../library/typing.rst:2851 |
4615 | 4620 | msgid "" |
4616 | | -"An ABC with one abstract method ``__abs__`` that is covariant in its return " |
4617 | | -"type." |
| 4621 | +"A protocol with one abstract method ``__abs__`` that is covariant in its " |
| 4622 | +"return type." |
4618 | 4623 | msgstr "" |
4619 | 4624 |
|
4620 | 4625 | #: ../../library/typing.rst:2856 |
4621 | | -msgid "An ABC with one abstract method ``__bytes__``." |
| 4626 | +#, fuzzy |
| 4627 | +msgid "A protocol with one abstract method ``__bytes__``." |
4622 | 4628 | msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" |
4623 | 4629 |
|
4624 | 4630 | #: ../../library/typing.rst:2860 |
4625 | | -msgid "An ABC with one abstract method ``__complex__``." |
| 4631 | +#, fuzzy |
| 4632 | +msgid "A protocol with one abstract method ``__complex__``." |
4626 | 4633 | msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" |
4627 | 4634 |
|
4628 | 4635 | #: ../../library/typing.rst:2864 |
4629 | | -msgid "An ABC with one abstract method ``__float__``." |
| 4636 | +#, fuzzy |
| 4637 | +msgid "A protocol with one abstract method ``__float__``." |
4630 | 4638 | msgstr "一個有抽象方法 ``__float__`` 的 ABC。" |
4631 | 4639 |
|
4632 | 4640 | #: ../../library/typing.rst:2868 |
4633 | | -msgid "An ABC with one abstract method ``__index__``." |
| 4641 | +#, fuzzy |
| 4642 | +msgid "A protocol with one abstract method ``__index__``." |
4634 | 4643 | msgstr "一個有抽象方法 ``__index__`` 的 ABC。" |
4635 | 4644 |
|
4636 | 4645 | #: ../../library/typing.rst:2874 |
4637 | | -msgid "An ABC with one abstract method ``__int__``." |
| 4646 | +#, fuzzy |
| 4647 | +msgid "A protocol with one abstract method ``__int__``." |
4638 | 4648 | msgstr "一個有抽象方法 ``__int__`` 的 ABC。" |
4639 | 4649 |
|
4640 | 4650 | #: ../../library/typing.rst:2878 |
4641 | 4651 | msgid "" |
4642 | | -"An ABC with one abstract method ``__round__`` that is covariant in its " |
| 4652 | +"A protocol with one abstract method ``__round__`` that is covariant in its " |
4643 | 4653 | "return type." |
4644 | 4654 | msgstr "" |
4645 | 4655 |
|
@@ -5689,8 +5699,8 @@ msgstr "常數" |
5689 | 5699 |
|
5690 | 5700 | #: ../../library/typing.rst:3598 |
5691 | 5701 | msgid "" |
5692 | | -"A special constant that is assumed to be ``True`` by 3rd party static type " |
5693 | | -"checkers. It's ``False`` at runtime." |
| 5702 | +"A special constant that is assumed to be ``True`` by static type checkers. " |
| 5703 | +"It's ``False`` at runtime." |
5694 | 5704 | msgstr "" |
5695 | 5705 |
|
5696 | 5706 | #: ../../library/typing.rst:3601 |
|
0 commit comments