diff --git a/library/typing.po b/library/typing.po index 88e5ca116c..3d666e2c27 100644 --- a/library/typing.po +++ b/library/typing.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-27 00:19+0000\n" -"PO-Revision-Date: 2018-05-23 16:14+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2023-09-05 14:49+0800\n" +"Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,10 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.1\n" #: ../../library/typing.rst:3 msgid ":mod:`typing` --- Support for type hints" -msgstr "" +msgstr ":mod:`typing` --- 支援型別提示" #: ../../library/typing.rst:16 msgid "**Source code:** :source:`Lib/typing.py`" @@ -32,6 +33,8 @@ msgid "" "They can be used by third party tools such as type checkers, IDEs, linters, " "etc." msgstr "" +"Python 執行環境不強制要求函式與變數的型別註釋。他們可以被第三方工具使用,如:" +"型別檢查器、IDE、linter 等。" #: ../../library/typing.rst:26 msgid "" @@ -39,11 +42,13 @@ msgid "" "specification of the typing system, see :pep:`484`. For a simplified " "introduction to type hints, see :pep:`483`." msgstr "" +"這個模組提供可以支援型別提示的 runtime。關於加註型別系統的原有規格" +",請看 :pep:`484`。關於型別提示的簡易介紹,請看 :pep:`483`。" #: ../../library/typing.rst:31 msgid "" "The function below takes and returns a string and is annotated as follows::" -msgstr "" +msgstr "以下函式接受及回傳都是使用字串,且註解方式如下: ::" #: ../../library/typing.rst:36 msgid "" @@ -51,6 +56,8 @@ msgid "" "type :class:`str` and the return type :class:`str`. Subtypes are accepted as " "arguments." msgstr "" +"在函式 ``greeting`` 當中,引數 ``name`` 的型別應為 :class:`str` 且回傳的型別" +"也是 :class:`str`。該引數也可以接受其子型別。" #: ../../library/typing.rst:40 msgid "" @@ -58,28 +65,37 @@ msgid "" "`typing_extensions `_ package " "provides backports of these new features to older versions of Python." msgstr "" +"新功能會頻繁的新增至 ``typing`` 模組中。`typing_extensions `_ 套件為這些新功能提供了 backport(向後移植的)版" +"本,提供給舊版本的 Python 使用。" #: ../../library/typing.rst:44 msgid "" "For a summary of deprecated features and a deprecation timeline, please see " "`Deprecation Timeline of Major Features`_." msgstr "" +"棄用功能及其棄用時間線的簡介,請看\\ `Deprecation Timeline of Major " +"Features`_ \\。" #: ../../library/typing.rst:50 msgid "" "`\"Typing cheat sheet\" `_" msgstr "" +"`\"型別小抄 (Typing cheat sheet)\" `_" #: ../../library/typing.rst:50 msgid "A quick overview of type hints (hosted at the mypy docs)" -msgstr "" +msgstr "型別提示的快速預覽(發布於 mypy 的文件中)" #: ../../library/typing.rst:55 msgid "" "\"Type System Reference\" section of `the mypy docs `_" msgstr "" +"`mypy 文件 `_\\ 的 \"型別系" +"統參考資料 (Type System Reference)\" 章節" #: ../../library/typing.rst:53 msgid "" @@ -87,21 +103,27 @@ msgid "" "broadly apply to most Python type checkers. (Some parts may still be " "specific to mypy.)" msgstr "" +"Python 的加註型別系統是基於 PEPs 進行標準化,所以這個參照 (reference) " +"應該在多數 Python 型別檢查器中廣為使用。(某些部分依然是特定給 mypy 使用。)" #: ../../library/typing.rst:59 msgid "" "`\"Static Typing with Python\" `_" msgstr "" +"`\"Python 的靜態型別 (Static Typing)\" `_" #: ../../library/typing.rst:58 msgid "" "Type-checker-agnostic documentation written by the community detailing type " "system features, useful typing related tools and typing best practices." msgstr "" +"由社群編寫的跨平台型別檢查器文件 (type-checker-agnostic) 詳細描述加註型別系統" +"的功能、實用的加註型別衍伸工具、以及加註型別的最佳實踐 (best practice)。" #: ../../library/typing.rst:65 msgid "Relevant PEPs" -msgstr "" +msgstr "相關的 PEPs" #: ../../library/typing.rst:67 msgid "" @@ -109,91 +131,103 @@ msgid "" "number of PEPs have modified and enhanced Python's framework for type " "annotations:" msgstr "" +"自從 :pep:`484` 及 :pep:`483` 對於型別提示的基礎引入,多個 PEPs 針對型別註釋" +"的 Python 框架進行修訂及加強:" #: ../../library/typing.rst:77 msgid ":pep:`526`: Syntax for Variable Annotations" -msgstr "" +msgstr ":pep:`526`:變數註釋的語法" #: ../../library/typing.rst:77 msgid "" "*Introducing* syntax for annotating variables outside of function " "definitions, and :data:`ClassVar`" -msgstr "" +msgstr "*引入*\\ 在定義函式之外的變數註釋語法,以及 :data:`ClassVar`" #: ../../library/typing.rst:80 msgid ":pep:`544`: Protocols: Structural subtyping (static duck typing)" msgstr "" +":pep:`544`: 協定:建構式子型別 (Structural Subtyping) (靜態鴨子型別," +"Static Duck Typing)" #: ../../library/typing.rst:80 msgid "" "*Introducing* :class:`Protocol` and the :func:" "`@runtime_checkable` decorator" msgstr "" +"*引入* :class:`Protocol` 以及 :func:`@runtime_checkable` " +"裝飾器 (decorator)" #: ../../library/typing.rst:83 msgid ":pep:`585`: Type Hinting Generics In Standard Collections" msgstr "" +":pep:`585`:基礎彙集 (collection) 中的型別提示泛型 (Type Hinting Generics In " +"Standard Collections)" #: ../../library/typing.rst:83 msgid "" "*Introducing* :class:`types.GenericAlias` and the ability to use standard " "library classes as :ref:`generic types`" msgstr "" +"*引入* :class:`types.GenericAlias` 以及使用基礎函式庫類別 :ref:`generic " +"types` 的能力" #: ../../library/typing.rst:85 msgid ":pep:`586`: Literal Types" -msgstr "" +msgstr ":pep:`586`:文字型別" #: ../../library/typing.rst:86 msgid "*Introducing* :data:`Literal`" -msgstr "" +msgstr "*引入* :data:`Literal`" #: ../../library/typing.rst:87 msgid "" ":pep:`589`: TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys" -msgstr "" +msgstr ":pep:`589`:TypedDict:含有一組固定 (fixed) 鍵值的型別提示字典" #: ../../library/typing.rst:88 msgid "*Introducing* :class:`TypedDict`" -msgstr "" +msgstr "*引入* :class:`TypedDict`" #: ../../library/typing.rst:89 msgid ":pep:`591`: Adding a final qualifier to typing" -msgstr "" +msgstr ":pep:`591`:為型別新增一個最終限定符 (final qualifier)" #: ../../library/typing.rst:90 msgid "*Introducing* :data:`Final` and the :func:`@final` decorator" -msgstr "" +msgstr "*引入* :data:`Final` 以及 :func:`@final` 裝飾器" #: ../../library/typing.rst:91 msgid ":pep:`593`: Flexible function and variable annotations" -msgstr "" +msgstr ":pep:`593`:彈性函式及變數註釋" #: ../../library/typing.rst:92 msgid "*Introducing* :data:`Annotated`" -msgstr "" +msgstr "*引入* :data:`Annotated`" #: ../../library/typing.rst:95 msgid ":pep:`604`: Allow writing union types as ``X | Y``" -msgstr "" +msgstr ":pep:`604`:允許寫入聯集型別 (union type) 為 ``X | Y``" #: ../../library/typing.rst:94 msgid "" "*Introducing* :data:`types.UnionType` and the ability to use the binary-or " "operator ``|`` to signify a :ref:`union of types`" msgstr "" +"*引入* :data:`types.UnionType` 以及使用 binary-or 運算子 ``|`` 以表示\\ :ref:" +"`型別聯合 `\\ 的能力" #: ../../library/typing.rst:97 msgid ":pep:`612`: Parameter Specification Variables" -msgstr "" +msgstr ":pep:`612`:參數規格變數 (Parameter Specification Variable)" #: ../../library/typing.rst:98 msgid "*Introducing* :class:`ParamSpec` and :data:`Concatenate`" -msgstr "" +msgstr "*引入* :class:`ParamSpec` 及 :data:`Concatenate`" #: ../../library/typing.rst:99 msgid ":pep:`613`: Explicit Type Aliases" -msgstr "" +msgstr ":pep:`613`:顯式型別別名 (Explicit Type Alias)" #: ../../library/typing.rst:100 msgid "*Introducing* :data:`TypeAlias`" @@ -201,7 +235,7 @@ msgstr "*引入* :data:`TypeAlias`" #: ../../library/typing.rst:101 msgid ":pep:`646`: Variadic Generics" -msgstr "" +msgstr ":pep:`646`:可變參數泛型 (Variadic Generic)" #: ../../library/typing.rst:102 msgid "*Introducing* :data:`TypeVarTuple`" @@ -209,7 +243,7 @@ msgstr "*引入* :data:`TypeVarTuple`" #: ../../library/typing.rst:103 msgid ":pep:`647`: User-Defined Type Guards" -msgstr "" +msgstr ":pep:`647`:使用者定義的型別防護 (Type Guard)" #: ../../library/typing.rst:104 msgid "*Introducing* :data:`TypeGuard`" @@ -219,7 +253,7 @@ msgstr "*引入* :data:`TypeGuard`" msgid "" ":pep:`655`: Marking individual TypedDict items as required or potentially " "missing" -msgstr "" +msgstr ":pep:`655`:標記個別的 TypedDict 物件為必需的或可能遺失的" #: ../../library/typing.rst:106 msgid "*Introducing* :data:`Required` and :data:`NotRequired`" @@ -227,7 +261,7 @@ msgstr "*引入* :data:`Required` 和 :data:`NotRequired`" #: ../../library/typing.rst:107 msgid ":pep:`673`: Self type" -msgstr "" +msgstr ":pep:`673`:Self 型別" #: ../../library/typing.rst:108 msgid "*Introducing* :data:`Self`" @@ -235,7 +269,7 @@ msgstr "*引入* :data:`Self`" #: ../../library/typing.rst:109 msgid ":pep:`675`: Arbitrary Literal String Type" -msgstr "" +msgstr ":pep:`675`:任意的文本字串型別 (Arbitrary Literal String Type)" #: ../../library/typing.rst:110 msgid "*Introducing* :data:`LiteralString`" @@ -243,7 +277,7 @@ msgstr "*引入* :data:`LiteralString`" #: ../../library/typing.rst:111 msgid ":pep:`681`: Data Class Transforms" -msgstr "" +msgstr ":pep:`681`:資料類別轉換" #: ../../library/typing.rst:112 msgid "" @@ -252,27 +286,28 @@ msgstr "*引入* :func:`@dataclass_transform` 裝飾器" #: ../../library/typing.rst:114 msgid ":pep:`692`: Using ``TypedDict`` for more precise ``**kwargs`` typing" -msgstr "" +msgstr ":pep:`692`:為更精準的 ``**kwargs`` 型別使用 ``TypedDict``" #: ../../library/typing.rst:114 msgid "" "*Introducing* a new way of typing ``**kwargs`` with :data:`Unpack` and :data:" "`TypedDict`" msgstr "" +"*引入* 型別 ``**kwargs`` 的新方式 :data:`Unpack` 以及 :data:`TypedDict`" #: ../../library/typing.rst:116 msgid ":pep:`695`: Type Parameter Syntax" -msgstr "" +msgstr ":pep:`695`:型別參數語法" #: ../../library/typing.rst:117 msgid "" "*Introducing* builtin syntax for creating generic functions, classes, and " "type aliases." -msgstr "" +msgstr "*引入*\\ 建立泛型函式、類別、型別別名的內建語法。" #: ../../library/typing.rst:119 msgid ":pep:`698`: Adding an override decorator to typing" -msgstr "" +msgstr ":pep:`698`:為型別新增可覆寫的裝飾器" #: ../../library/typing.rst:119 msgid "*Introducing* the :func:`@override` decorator" @@ -280,7 +315,7 @@ msgstr "*引入* :func:`@override` 裝飾器" #: ../../library/typing.rst:129 msgid "Type aliases" -msgstr "" +msgstr "型別別名" #: ../../library/typing.rst:131 msgid "" @@ -288,24 +323,33 @@ msgid "" "an instance of :class:`TypeAliasType`. In this example, ``Vector`` and " "``list[float]`` will be treated equivalently by static type checkers::" msgstr "" +"一個型別別名被定義來使用 :keyword:`type` 陳述式,其建立了 :class:" +"`TypeAliasType` 的實例。在這個範例中,``Vector`` 及 ``list[float]`` 會被當作" +"和靜態型別檢查器一樣同等對待: ::" #: ../../library/typing.rst:144 msgid "" "Type aliases are useful for simplifying complex type signatures. For " "example::" msgstr "" +"型別別名對於簡化複雜的型別簽名 (complex type signature) 非常好用。舉例來" +"說: ::" #: ../../library/typing.rst:162 msgid "" "The :keyword:`type` statement is new in Python 3.12. For backwards " "compatibility, type aliases can also be created through simple assignment::" msgstr "" +":keyword:`type` 陳述式是 Python 3.12 的新功能。為了向後相容性,型別別名可以透" +"過簡單的賦值來建立: ::" #: ../../library/typing.rst:167 msgid "" "Or marked with :data:`TypeAlias` to make it explicit that this is a type " "alias, not a normal variable assignment::" msgstr "" +"或是用 :data:`TypeAlias` 標記,讓它明確的表示這是一個型別別名,而非一般的變數" +"賦值: ::" #: ../../library/typing.rst:177 msgid "NewType" @@ -407,9 +451,9 @@ msgstr "" #: ../../library/typing.rst:254 ../../library/typing.rst:2679 msgid "For example:" -msgstr "舉例來說" +msgstr "舉例來說:" -#: ../../library/typing.rst:272 +#: ../../library/typing.rst:272 ../../library/typing.rst:995 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " @@ -992,14 +1036,6 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:995 -msgid "" -"The subscription syntax must always be used with exactly two values: the " -"argument list and the return type. The argument list must be a list of " -"types, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " -"type must be a single type." -msgstr "" - #: ../../library/typing.rst:1000 msgid "" "There is no syntax to indicate optional or keyword arguments; such function "