Skip to content

Commit c625bf2

Browse files
sync with cpython 2dd91d2b
1 parent ed49702 commit c625bf2

2 files changed

Lines changed: 114 additions & 84 deletions

File tree

library/typing.po

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: Python 3.14\n"
88
"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"
1010
"PO-Revision-Date: 2024-07-11 11:12+0800\n"
1111
"Last-Translator: Li-Hung Wang <therockleona@gmail.com>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -1302,10 +1302,11 @@ msgid "The :data:`Any` type"
13021302
msgstr ":data:`Any` 型別"
13031303

13041304
#: ../../library/typing.rst:721
1305+
#, fuzzy
13051306
msgid ""
13061307
"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."
13091310
msgstr ""
13101311
":data:`Any` 是一種特別的型別。一個靜態型別檢查器會將每個型別視為可相容於 :"
13111312
"data:`Any` 且 :data:`Any` 也可以相容於每個型別。"
@@ -1413,7 +1414,7 @@ msgid ""
14131414
"hash_a(42)\n"
14141415
"hash_a(\"foo\")\n"
14151416
"\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"
14171418
"hash_b(42)\n"
14181419
"hash_b(\"foo\")"
14191420
msgstr ""
@@ -1541,11 +1542,13 @@ msgid "Special type indicating an unconstrained type."
15411542
msgstr "特別型別,指出一個不受約束 (unconstrained) 的型別。"
15421543

15431544
#: ../../library/typing.rst:854
1544-
msgid "Every type is compatible with :data:`Any`."
1545+
#, fuzzy
1546+
msgid "Every type is assignable to :data:`Any`."
15451547
msgstr "所有型別皆與 :data:`Any` 相容。"
15461548

15471549
#: ../../library/typing.rst:855
1548-
msgid ":data:`Any` is compatible with every type."
1550+
#, fuzzy
1551+
msgid ":data:`Any` is assignable to every type."
15491552
msgstr ":data:`Any` 相容於所有型別。"
15501553

15511554
#: ../../library/typing.rst:857
@@ -2289,11 +2292,12 @@ msgid ":data:`ClassVar` accepts only types and cannot be further subscribed."
22892292
msgstr ":data:`ClassVar` 只接受型別請不得使用下標。"
22902293

22912294
#: ../../library/typing.rst:1295
2295+
#, fuzzy
22922296
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:"
22942298
"`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::"
22972301
msgstr ""
22982302
":data:`ClassVar` 並不代表該類別本身,而且不應該和 :func:`isinstance` 或是 :"
22992303
"func:`issubclass` 一起使用。:data:`ClassVar` 不會改變 Python runtime 的行為,"
@@ -2375,14 +2379,15 @@ msgid ""
23752379
msgstr "特殊型別建構,用來標記一個 :class:`TypedDict` 的項目是唯讀的。"
23762380

23772381
#: ../../library/typing.rst:1362
2382+
#, fuzzy
23782383
msgid ""
23792384
"class Movie(TypedDict):\n"
23802385
" title: ReadOnly[str]\n"
23812386
" year: int\n"
23822387
"\n"
23832388
"def mutate_movie(m: Movie) -> None:\n"
23842389
" m[\"year\"] = 1999 # allowed\n"
2385-
" m[\"title\"] = \"The Matrix\" # typechecker error"
2390+
" m[\"title\"] = \"The Matrix\" # type checker error"
23862391
msgstr ""
23872392
"class Movie(TypedDict):\n"
23882393
" title: ReadOnly[str]\n"
@@ -3883,11 +3888,11 @@ msgstr ""
38833888

38843889
#: ../../library/typing.rst:2384
38853890
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.)"
38913896
msgstr ""
38923897

38933898
#: ../../library/typing.rst:2390
@@ -3996,7 +4001,7 @@ msgstr ""
39964001

39974002
#: ../../library/typing.rst:2460
39984003
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, "
40004005
"however, calling a ``NewType`` returns its argument unchanged."
40014006
msgstr ""
40024007

@@ -4109,7 +4114,7 @@ msgstr ""
41094114
#: ../../library/typing.rst:2534
41104115
msgid ""
41114116
"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 "
41134118
"ponies\" in :mod:`collections.abc` such as :class:`~collections.abc."
41144119
"Iterable`. For example::"
41154120
msgstr ""
@@ -4439,9 +4444,9 @@ msgstr ""
44394444

44404445
#: ../../library/typing.rst:2726
44414446
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:"
44454450
msgstr ""
44464451

44474452
#: ../../library/typing.rst:2732
@@ -4502,8 +4507,8 @@ msgstr ""
45024507
msgid ""
45034508
"For backwards compatibility with Python 3.10 and below, it is also possible "
45044509
"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 "
45074512
"``TypedDict`` with a different value for ``total``:"
45084513
msgstr ""
45094514

@@ -4613,33 +4618,38 @@ msgstr ""
46134618

46144619
#: ../../library/typing.rst:2851
46154620
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."
46184623
msgstr ""
46194624

46204625
#: ../../library/typing.rst:2856
4621-
msgid "An ABC with one abstract method ``__bytes__``."
4626+
#, fuzzy
4627+
msgid "A protocol with one abstract method ``__bytes__``."
46224628
msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。"
46234629

46244630
#: ../../library/typing.rst:2860
4625-
msgid "An ABC with one abstract method ``__complex__``."
4631+
#, fuzzy
4632+
msgid "A protocol with one abstract method ``__complex__``."
46264633
msgstr "一個有抽象方法 ``__complex__`` 的 ABC。"
46274634

46284635
#: ../../library/typing.rst:2864
4629-
msgid "An ABC with one abstract method ``__float__``."
4636+
#, fuzzy
4637+
msgid "A protocol with one abstract method ``__float__``."
46304638
msgstr "一個有抽象方法 ``__float__`` 的 ABC。"
46314639

46324640
#: ../../library/typing.rst:2868
4633-
msgid "An ABC with one abstract method ``__index__``."
4641+
#, fuzzy
4642+
msgid "A protocol with one abstract method ``__index__``."
46344643
msgstr "一個有抽象方法 ``__index__`` 的 ABC。"
46354644

46364645
#: ../../library/typing.rst:2874
4637-
msgid "An ABC with one abstract method ``__int__``."
4646+
#, fuzzy
4647+
msgid "A protocol with one abstract method ``__int__``."
46384648
msgstr "一個有抽象方法 ``__int__`` 的 ABC。"
46394649

46404650
#: ../../library/typing.rst:2878
46414651
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 "
46434653
"return type."
46444654
msgstr ""
46454655

@@ -5689,8 +5699,8 @@ msgstr "常數"
56895699

56905700
#: ../../library/typing.rst:3598
56915701
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."
56945704
msgstr ""
56955705

56965706
#: ../../library/typing.rst:3601

0 commit comments

Comments
 (0)