Sync with cpython and translate new/fuzzy entries from upstream sync by mattwang44 · Pull Request #1239 · python/python-docs-zh-tw · GitHub
Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CLAUDE.md
9 changes: 9 additions & 0 deletions c-api/arg.po
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,10 @@ msgid ""
"corresponding C variable(s). For example, the format string ``\"OO|OO\"`` "
"corresponds to the Python signature ``f(a, b, c=None, d=None)``."
msgstr ""
"表示 Python 引數列表中剩餘的引數為可選的。與可選引數相對應的 C 變數應初始化為"
"其預設值 --- 當可選引數未被指定時,:c:func:`PyArg_ParseTuple` 不會更動相應 C "
"變數的內容。例如,格式字串 ``\"OO|OO\"`` 對應於 Python 簽名 ``f(a, b, "
"c=None, d=None)``。"

#: ../../c-api/arg.rst:398
msgid "``$``"
Expand All @@ -756,6 +760,11 @@ msgid ""
"corresponds to the Python signature ``f(a, b=None, *, c=None)``, and the "
"format string ``\"OO$OO\"`` corresponds to ``f(a, b, *, c, d)``."
msgstr ""
"僅限 :c:func:`PyArg_ParseTupleAndKeywords`:表示 Python 引數列表中剩餘的引數"
"皆為僅限關鍵字引數。若 ``$`` 之前指定了 ``|``,則它們為可選;否則為必要。``|"
"`` 不能在 ``$`` 之後指定。例如,格式字串 ``\"O|O$O\"`` 對應到 Python 簽名 "
"``f(a, b=None, *, c=None)``,格式字串 ``\"OO$OO\"`` 則對應到 ``f(a, b, *, c, "
"d)``。"

#: ../../c-api/arg.rst:410
msgid "``:``"
Expand Down
5 changes: 1 addition & 4 deletions c-api/buffer.po
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,8 @@ msgid ""
msgstr ""

#: ../../c-api/buffer.rst:266
#, fuzzy
msgid "This is an alias to :c:macro:`PyBUF_WRITABLE`."
msgstr ""
"這是 :c:macro:`PyBUF_WRITABLE` 的\\ :term:`軟性棄用 <soft deprecated>`\\ 別"
"名。"
msgstr "此為 :c:macro:`PyBUF_WRITABLE` 的別名。"

#: ../../c-api/buffer.rst:272
msgid ""
Expand Down
4 changes: 4 additions & 0 deletions c-api/bytes.po
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ msgid ""
"\"stolen\", the value of *\\*bytes* will be set to ``NULL``, and the "
"appropriate exception will be set."
msgstr ""
"在 *\\*bytes* 中建立一個新的 bytes 物件,其內容為 *newpart* 附加到 *bytes* 之"
"後的結果;呼叫者將擁有新的參照。*bytes* 舊值的參照將被「:term:`竊取 "
"<steal>`」。如果無法建立新物件,*bytes* 的舊參照仍將被「竊取」,*\\*bytes* 的"
"值將被設為 ``NULL``,並會設定適當的例外。"

#: ../../c-api/bytes.rst:190 ../../c-api/bytes.rst:200
msgid ""
Expand Down
2 changes: 1 addition & 1 deletion c-api/code.po
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ msgstr ""

#: ../../c-api/code.rst:217
msgid "This is a function that does nothing."
msgstr ""
msgstr "此函式不執行任何操作。"

#: ../../c-api/code.rst:219
msgid ""
Expand Down
49 changes: 47 additions & 2 deletions c-api/descriptor.po
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ msgid ""
"Create a new get-set descriptor for extension type *type* from the :c:type:"
"`PyGetSetDef` structure *getset*."
msgstr ""
"從 :c:type:`PyGetSetDef` 結構 *getset* 為擴充型別 *type* 建立一個新的 get-"
"set 描述器。"

#: ../../c-api/descriptor.rst:21
msgid ""
Expand All @@ -50,6 +52,10 @@ msgid ""
"of descriptor created for entries in :c:member:`~PyTypeObject.tp_getset`, "
"and it appears in Python as a :class:`types.GetSetDescriptorType` object."
msgstr ""
"get-set 描述器所公開的屬性是由 C 取得器 (getter) 和設定器 (setter) 函式實作"
"的,而不是直接儲存在實例中。這與 :c:member:`~PyTypeObject.tp_getset` 中各項目"
"所建立的是同一種描述器,並在 Python 中以 :class:`types.GetSetDescriptorType` "
"物件的形式呈現。"

#: ../../c-api/descriptor.rst:26 ../../c-api/descriptor.rst:39
#: ../../c-api/descriptor.rst:70 ../../c-api/descriptor.rst:101
Expand All @@ -58,12 +64,16 @@ msgid ""
"On success, return a :term:`strong reference` to the descriptor. Return "
"``NULL`` with an exception set on failure."
msgstr ""
"成功時,回傳一個對描述器的 :term:`strong reference`\\ 。失敗時,回傳 "
"``NULL`` 並設定例外。"

#: ../../c-api/descriptor.rst:31
msgid ""
"Create a new member descriptor for extension type *type* from the :c:type:"
"`PyMemberDef` structure *member*."
msgstr ""
"從 :c:type:`PyMemberDef` 結構 *member* 為擴充型別 *type* 建立一個新的 member "
"描述器。"

#: ../../c-api/descriptor.rst:34
msgid ""
Expand All @@ -72,6 +82,9 @@ msgid ""
"member:`~PyTypeObject.tp_members`, and it appears in Python as a :class:"
"`types.MemberDescriptorType` object."
msgstr ""
"member 描述器將型別的 C 結構欄位公開為 Python 屬性。這與 :c:member:"
"`~PyTypeObject.tp_members` 中各項目所建立的是同一種描述器,並在 Python 中以 :"
"class:`types.MemberDescriptorType` 物件的形式呈現。"

#: ../../c-api/descriptor.rst:44
msgid ""
Expand All @@ -89,12 +102,17 @@ msgid ""
"type attributes. They correspond to :class:`types.GetSetDescriptorType` "
"objects in Python."
msgstr ""
"此為由 :c:type:`PyGetSetDef` 結構所建立的 get-set 描述器物件的型別物件。這些"
"描述器實作了值由 C 取得器和設定器函式計算得出的屬性,並用於許多內建型別屬性。"
"它們對應於 Python 中的 :class:`types.GetSetDescriptorType` 物件。"

#: ../../c-api/descriptor.rst:62
msgid ""
"Create a new method descriptor for extension type *type* from the :c:type:"
"`PyMethodDef` structure *meth*."
msgstr ""
"從 :c:type:`PyMethodDef` 結構 *meth* 為擴充型別 *type* 建立一個新的 method 描"
"述器。"

#: ../../c-api/descriptor.rst:65
msgid ""
Expand All @@ -103,6 +121,9 @@ msgid ""
"tp_methods`, and it appears in Python as a :class:`types."
"MethodDescriptorType` object."
msgstr ""
"method 描述器將 C 函式公開為型別上的方法。這與 :c:member:`~PyTypeObject."
"tp_methods` 中各項目所建立的是同一種描述器,並在 Python 中以 :class:`types."
"MethodDescriptorType` 物件的形式呈現。"

#: ../../c-api/descriptor.rst:75
msgid ""
Expand All @@ -111,24 +132,31 @@ msgid ""
"a type, and correspond to :class:`types.MethodDescriptorType` objects in "
"Python."
msgstr ""
"此為由 :c:type:`PyMethodDef` 結構所建立的 method 描述器物件的型別物件。這些描"
"述器將 C 函式公開為型別上的方法,並對應於 Python 中的 :class:`types."
"MethodDescriptorType` 物件。"

#: ../../c-api/descriptor.rst:83
msgid "Describes a slot wrapper used by :c:func:`PyDescr_NewWrapper`."
msgstr ""
msgstr "描述由 :c:func:`PyDescr_NewWrapper` 所使用的 slot wrapper。"

#: ../../c-api/descriptor.rst:85
msgid ""
"Each ``wrapperbase`` record stores the Python-visible name and metadata for "
"a special method implemented by a type slot, together with the wrapper "
"function used to adapt that slot to Python's calling convention."
msgstr ""
"每筆 ``wrapperbase`` 紀錄都儲存了由某個型別 slot 所實作的特殊方法之 Python 可"
"見名稱與中繼資料,以及用來將該 slot 轉接為 Python 呼叫慣例的 wrapper 函式。"

#: ../../c-api/descriptor.rst:91
msgid ""
"Create a new wrapper descriptor for extension type *type* from the :c:struct:"
"`wrapperbase` structure *base* and the wrapped slot function pointer "
"*wrapped*."
msgstr ""
"從 :c:struct:`wrapperbase` 結構 *base* 和被包裝的 slot 函式指標 *wrapped* 為"
"擴充型別 *type* 建立一個新的 wrapper 描述器。"

#: ../../c-api/descriptor.rst:96
msgid ""
Expand All @@ -137,6 +165,9 @@ msgid ""
"methods such as ``__repr__`` or ``__add__``, and it appears in Python as a :"
"class:`types.WrapperDescriptorType` object."
msgstr ""
"wrapper 描述器將由型別 slot 實作的特殊方法公開出來。這與 CPython 為 "
"``__repr__``\\ 、``__add__`` 等基於 slot 的特殊方法所建立的是同一種描述器,並"
"在 Python 中以 :class:`types.WrapperDescriptorType` 物件的形式呈現。"

#: ../../c-api/descriptor.rst:106
msgid ""
Expand All @@ -152,6 +183,8 @@ msgid ""
"Create a new class method descriptor for extension type *type* from the :c:"
"type:`PyMethodDef` structure *method*."
msgstr ""
"從 :c:type:`PyMethodDef` 結構 *method* 為擴充型別 *type* 建立一個新的 class "
"method 描述器。"

#: ../../c-api/descriptor.rst:118
msgid ""
Expand All @@ -160,6 +193,10 @@ msgid ""
"``METH_CLASS`` entries in :c:member:`~PyTypeObject.tp_methods`, and it "
"appears in Python as a :class:`types.ClassMethodDescriptorType` object."
msgstr ""
"class method 描述器所公開的 C 方法,在被存取時接收的是類別本身而非實例。這"
"與 :c:member:`~PyTypeObject.tp_methods` 中 ``METH_CLASS`` 項目所建立的是同一"
"種描述器,並在 Python 中以 :class:`types.ClassMethodDescriptorType` 物件的形"
"式呈現。"

#: ../../c-api/descriptor.rst:128
msgid ""
Expand All @@ -174,7 +211,7 @@ msgstr ""
msgid ""
"Create a new bound wrapper object from the wrapper descriptor *d* and the "
"instance *self*."
msgstr ""
msgstr "從 wrapper 描述器 *d* 和實例 *self* 建立一個新的已繫結 wrapper 物件。"

#: ../../c-api/descriptor.rst:138
msgid ""
Expand All @@ -183,12 +220,17 @@ msgid ""
"accessed through an instance, and they appear in Python as :class:`types."
"MethodWrapperType` objects."
msgstr ""
"這是由 :c:func:`PyDescr_NewWrapper` 所建立的 wrapper 描述器的已繫結形式。當 "
"slot wrapper 透過實例被存取時,CPython 就會建立這些物件,它們在 Python 中以 :"
"class:`types.MethodWrapperType` 物件的形式出現。"

#: ../../c-api/descriptor.rst:143
msgid ""
"On success, return a :term:`strong reference` to the wrapper object. Return "
"``NULL`` with an exception set on failure."
msgstr ""
"成功時,回傳一個對 wrapper 物件的 :term:`strong reference`\\ 。失敗時,回傳 "
"``NULL`` 並設定例外。"

#: ../../c-api/descriptor.rst:147
msgid "Built-in descriptors"
Expand All @@ -213,6 +255,9 @@ msgid ""
"extension types, and corresponds to :class:`types.ClassMethodDescriptorType` "
"objects in Python."
msgstr ""
"此為 C 層級 class method 描述器物件的型別物件。這是為 C 擴充型別中定義的 :"
"func:`classmethod` 所建立的描述器之型別,並對應於 Python 中的 :class:`types."
"ClassMethodDescriptorType` 物件。"

#: ../../c-api/descriptor.rst:171
msgid ""
Expand Down
3 changes: 3 additions & 0 deletions c-api/dict.po
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ msgid ""
"on success or ``-1`` on failure. This function *does not* \":term:`steal`\" "
"a reference to *val*."
msgstr ""
"以 *key* 為鍵,將 *val* 插入至字典 *p* 中。*key* 必須是\\ :term:`可雜湊的 "
"<hashable>`,否則將引發 :exc:`TypeError`。成功時回傳 ``0``,失敗時回傳 "
"``-1``。此函式\\ *不會*\\ 「:term:`竊取 <steal>`」對 *val* 的參照。"

#: ../../c-api/dict.rst:103
msgid ""
Expand Down
32 changes: 26 additions & 6 deletions c-api/exceptions.po
Loading
Loading