Skip to content

Sync with CPython 3.12 #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 29, 2023
Merged
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
67 changes: 34 additions & 33 deletions c-api/allocation.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-06 00:17+0000\n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"PO-Revision-Date: 2022-10-16 15:35+0800\n"
"Last-Translator: Matt Wang <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -49,48 +49,49 @@ msgstr ""
#: ../../c-api/allocation.rst:32
msgid ""
"Allocate a new Python object using the C structure type *TYPE* and the "
"Python type object *type*. Fields not defined by the Python object header "
"are not initialized; the object's reference count will be one. The size of "
"the memory allocation is determined from the :c:member:`~PyTypeObject."
"tp_basicsize` field of the type object."
"Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the "
"Python object header are not initialized; the object's reference count will "
"be one. The size of the memory allocation is determined from the :c:member:"
"`~PyTypeObject.tp_basicsize` field of the type object."
msgstr ""
"使用 C 結構型別 *TYPE* 和 Python 型別物件 *type* 分配一個新的 Python 物件。未"
"在該 Python 物件標頭 (header) 中定義的欄位不會被初始化;物件的參照計數將為"
"。記憶體分配大小由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位"
"來指定。"
"使用 C 結構型別 *TYPE* 和 Python 型別物件 *typeobj* (``PyTypeObject*``) 分配"
"一個新的 Python 物件。未在該 Python 物件標頭 (header) 中定義的欄位不會被初始"
"化;物件的參照計數將為一。記憶體分配大小由 type 物件的 :c:member:"
"`~PyTypeObject.tp_basicsize` 欄位來指定。"

#: ../../c-api/allocation.rst:41
#: ../../c-api/allocation.rst:42
msgid ""
"Allocate a new Python object using the C structure type *TYPE* and the "
"Python type object *type*. Fields not defined by the Python object header "
"are not initialized. The allocated memory allows for the *TYPE* structure "
"plus *size* fields of the size given by the :c:member:`~PyTypeObject."
"tp_itemsize` field of *type*. This is useful for implementing objects like "
"tuples, which are able to determine their size at construction time. "
"Embedding the array of fields into the same allocation decreases the number "
"of allocations, improving the memory management efficiency."
"Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the "
"Python object header are not initialized. The allocated memory allows for "
"the *TYPE* structure plus *size* (``Py_ssize_t``) fields of the size given "
"by the :c:member:`~PyTypeObject.tp_itemsize` field of *typeobj*. This is "
"useful for implementing objects like tuples, which are able to determine "
"their size at construction time. Embedding the array of fields into the "
"same allocation decreases the number of allocations, improving the memory "
"management efficiency."
msgstr ""
"使用 C 的結構型別 *TYPE* 和 Python 的型別物件 *type* 分配一個新的 Python 物"
"。未在該 Python 物件標頭中定義的欄位不會被初始化。記憶體空間預留了 *TYPE* "
"結構大小再加上 *type* 物件中 :c:member:`~PyTypeObject.tp_itemsize` 欄位提供"
"*size* 欄位的值。這對於實現如 tuple 這種能夠在建立期間決定自己大小的物件是"
"很實用的。將欄位的陣列嵌入到相同的記憶體分配中可以減少記憶體分配的次數,這提"
"高了記憶體管理的效率。"
"使用 C 的結構型別 *TYPE* 和 Python 的型別物件 *typeobj* (``PyTypeObject*``) "
"分配一個新的 Python 物件。未在該 Python 物件標頭中定義的欄位不會被初始化。"
"憶體空間預留了 *TYPE* 結構大小再加上 *typeobj* 物件中 :c:member:"
"`~PyTypeObject.tp_itemsize` 欄位提供的 *size* (``Py_ssize_t``) 欄位的值。這對"
"於實現如 tuple 這種能夠在建立期間決定自己大小的物件是很實用的。將欄位的陣列嵌"
"入到相同的記憶體分配中可以減少記憶體分配的次數,這提高了記憶體管理的效率。"

#: ../../c-api/allocation.rst:53
#: ../../c-api/allocation.rst:56
msgid ""
"Releases memory allocated to an object using :c:func:`PyObject_New` or :c:"
"func:`PyObject_NewVar`. This is normally called from the :c:member:"
"Releases memory allocated to an object using :c:macro:`PyObject_New` or :c:"
"macro:`PyObject_NewVar`. This is normally called from the :c:member:"
"`~PyTypeObject.tp_dealloc` handler specified in the object's type. The "
"fields of the object should not be accessed after this call as the memory is "
"no longer a valid Python object."
msgstr ""
"釋放由 :c:func:`PyObject_New` 或者 :c:func:`PyObject_NewVar` 分配給物件的記憶"
"。這通常是在物件型別所指定的 :c:member:`~PyTypeObject.tp_dealloc` handler "
"中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的記憶體已"
"不再是一個有效的 Python 物件。"
"釋放由 :c:macro:`PyObject_New` 或者 :c:macro:`PyObject_NewVar` 分配給物件的記"
"憶體。這通常是在物件型別所指定的 :c:member:`~PyTypeObject.tp_dealloc` "
"handler 中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的"
"記憶體已不再是一個有效的 Python 物件。"

#: ../../c-api/allocation.rst:62
#: ../../c-api/allocation.rst:65
msgid ""
"Object which is visible in Python as ``None``. This should only be accessed "
"using the :c:macro:`Py_None` macro, which evaluates to a pointer to this "
Expand All @@ -99,10 +100,10 @@ msgstr ""
"這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存"
"取,該巨集的拿到指向該物件的指標。"

#: ../../c-api/allocation.rst:69
#: ../../c-api/allocation.rst:72
msgid ":c:func:`PyModule_Create`"
msgstr ":c:func:`PyModule_Create`"

#: ../../c-api/allocation.rst:70
#: ../../c-api/allocation.rst:73
msgid "To allocate and create extension modules."
msgstr "分配記憶體和建立擴充模組。"
6 changes: 3 additions & 3 deletions c-api/apiabiversion.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-18 00:16+0000\n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"PO-Revision-Date: 2022-01-24 22:34+0800\n"
"Last-Translator: Matt Wang <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -177,8 +177,8 @@ msgid "Use this for numeric comparisons, e.g. ``#if PY_VERSION_HEX >= ...``."
msgstr "使用它進行數值比較,例如 ``#if PY_VERSION_HEX >= ...``。"

#: ../../c-api/apiabiversion.rst:63
msgid "This version is also available via the symbol :data:`Py_Version`."
msgstr "該版本也可透過符號 :data:`Py_Version` 獲得。"
msgid "This version is also available via the symbol :c:var:`Py_Version`."
msgstr "該版本也可透過符號 :c:var:`Py_Version` 獲得。"

#: ../../c-api/apiabiversion.rst:67
msgid ""
Expand Down
4 changes: 2 additions & 2 deletions c-api/arg.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-24 00:03+0000\n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"PO-Revision-Date: 2022-10-16 03:21+0800\n"
"Last-Translator: Adrian Liaw <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -824,7 +824,7 @@ msgstr ""
#: ../../c-api/arg.rst:471
msgid ""
"This is an example of the use of this function, taken from the sources for "
"the :mod:`_weakref` helper module for weak references::"
"the :mod:`!_weakref` helper module for weak references::"
msgstr ""

#: ../../c-api/arg.rst:487
Expand Down
4 changes: 2 additions & 2 deletions c-api/buffer.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-24 00:03+0000\n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"PO-Revision-Date: 2018-05-23 14:30+0000\n"
"Last-Translator: Adrian Liaw <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -70,7 +70,7 @@ msgstr ""
msgid ""
"An example consumer of the buffer interface is the :meth:`~io.BufferedIOBase."
"write` method of file objects: any object that can export a series of bytes "
"through the buffer interface can be written to a file. While :meth:`write` "
"through the buffer interface can be written to a file. While :meth:`!write` "
"only needs read-only access to the internal contents of the object passed to "
"it, other methods such as :meth:`~io.BufferedIOBase.readinto` need write "
"access to the contents of their argument. The buffer interface allows "
Expand Down
50 changes: 25 additions & 25 deletions c-api/bytes.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-17 17:39+0800\n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"PO-Revision-Date: 2018-05-23 14:04+0000\n"
"Last-Translator: Adrian Liaw <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -87,8 +87,8 @@ msgid "Comment"
msgstr ""

#: ../../c-api/bytes.rst:67
msgid ":attr:`%%`"
msgstr ":attr:`%%`"
msgid "``%%``"
msgstr "``%%``"

#: ../../c-api/bytes.rst:67
msgid "*n/a*"
Expand All @@ -99,8 +99,8 @@ msgid "The literal % character."
msgstr ""

#: ../../c-api/bytes.rst:69
msgid ":attr:`%c`"
msgstr ":attr:`%c`"
msgid "``%c``"
msgstr "``%c``"

#: ../../c-api/bytes.rst:69 ../../c-api/bytes.rst:72 ../../c-api/bytes.rst:90
#: ../../c-api/bytes.rst:93
Expand All @@ -112,16 +112,16 @@ msgid "A single byte, represented as a C int."
msgstr ""

#: ../../c-api/bytes.rst:72
msgid ":attr:`%d`"
msgstr ":attr:`%d`"
msgid "``%d``"
msgstr "``%d``"

#: ../../c-api/bytes.rst:72
msgid "Equivalent to ``printf(\"%d\")``. [1]_"
msgstr "等價於 ``printf(\"%d\")``. [1]_"

#: ../../c-api/bytes.rst:75
msgid ":attr:`%u`"
msgstr ":attr:`%u`"
msgid "``%u``"
msgstr "``%u``"

#: ../../c-api/bytes.rst:75
msgid "unsigned int"
Expand All @@ -132,8 +132,8 @@ msgid "Equivalent to ``printf(\"%u\")``. [1]_"
msgstr "等價於 ``printf(\"%u\")``. [1]_"

#: ../../c-api/bytes.rst:78
msgid ":attr:`%ld`"
msgstr ":attr:`%ld`"
msgid "``%ld``"
msgstr "``%ld``"

#: ../../c-api/bytes.rst:78
msgid "long"
Expand All @@ -144,8 +144,8 @@ msgid "Equivalent to ``printf(\"%ld\")``. [1]_"
msgstr "等價於 ``printf(\"%ld\")``. [1]_"

#: ../../c-api/bytes.rst:81
msgid ":attr:`%lu`"
msgstr ":attr:`%lu`"
msgid "``%lu``"
msgstr "``%lu``"

#: ../../c-api/bytes.rst:81
msgid "unsigned long"
Expand All @@ -156,8 +156,8 @@ msgid "Equivalent to ``printf(\"%lu\")``. [1]_"
msgstr "等價於 ``printf(\"%lu\")``. [1]_"

#: ../../c-api/bytes.rst:84
msgid ":attr:`%zd`"
msgstr ":attr:`%zd`"
msgid "``%zd``"
msgstr "``%zd``"

#: ../../c-api/bytes.rst:84
msgid ":c:type:`\\ Py_ssize_t`"
Expand All @@ -168,8 +168,8 @@ msgid "Equivalent to ``printf(\"%zd\")``. [1]_"
msgstr "等價於 ``printf(\"%zd\")``. [1]_"

#: ../../c-api/bytes.rst:87
msgid ":attr:`%zu`"
msgstr ":attr:`%zu`"
msgid "``%zu``"
msgstr "``%zu``"

#: ../../c-api/bytes.rst:87
msgid "size_t"
Expand All @@ -180,24 +180,24 @@ msgid "Equivalent to ``printf(\"%zu\")``. [1]_"
msgstr "等價於 ``printf(\"%zu\")``. [1]_"

#: ../../c-api/bytes.rst:90
msgid ":attr:`%i`"
msgstr ":attr:`%i`"
msgid "``%i``"
msgstr "``%i``"

#: ../../c-api/bytes.rst:90
msgid "Equivalent to ``printf(\"%i\")``. [1]_"
msgstr "等價於 ``printf(\"%i\")``. [1]_"

#: ../../c-api/bytes.rst:93
msgid ":attr:`%x`"
msgstr ":attr:`%x`"
msgid "``%x``"
msgstr "``%x``"

#: ../../c-api/bytes.rst:93
msgid "Equivalent to ``printf(\"%x\")``. [1]_"
msgstr "等價於 ``printf(\"%x\")``. [1]_"

#: ../../c-api/bytes.rst:96
msgid ":attr:`%s`"
msgstr ":attr:`%s`"
msgid "``%s``"
msgstr "``%s``"

#: ../../c-api/bytes.rst:96
msgid "const char\\*"
Expand All @@ -208,8 +208,8 @@ msgid "A null-terminated C character array."
msgstr ""

#: ../../c-api/bytes.rst:99
msgid ":attr:`%p`"
msgstr ":attr:`%p`"
msgid "``%p``"
msgstr "``%p``"

#: ../../c-api/bytes.rst:99
msgid "const void\\*"
Expand Down
8 changes: 4 additions & 4 deletions c-api/capsule.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-05-09 00:15+0000\n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"PO-Revision-Date: 2018-05-23 14:30+0000\n"
"Last-Translator: Adrian Liaw <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -93,7 +93,7 @@ msgstr ""
msgid ""
"The *name* parameter must compare exactly to the name stored in the capsule. "
"If the name stored in the capsule is ``NULL``, the *name* passed in must "
"also be ``NULL``. Python uses the C function :c:func:`strcmp` to compare "
"also be ``NULL``. Python uses the C function :c:func:`!strcmp` to compare "
"capsule names."
msgstr ""

Expand Down Expand Up @@ -166,8 +166,8 @@ msgstr ""
#: ../../c-api/capsule.rst:123
msgid ""
"In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls "
"to any of the accessors (any function starting with :c:func:`PyCapsule_Get`) "
"are guaranteed to succeed."
"to any of the accessors (any function starting with ``PyCapsule_Get``) are "
"guaranteed to succeed."
msgstr ""

#: ../../c-api/capsule.rst:127
Expand Down
10 changes: 5 additions & 5 deletions c-api/code.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-17 17:39+0800\n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -60,7 +60,7 @@ msgstr ""
#: ../../c-api/code.rst:41
msgid ""
"Since the definition of the bytecode changes often, calling :c:func:"
"`PyCode_New` directly can bind you to a precise Python version."
"`PyUnstable_Code_New` directly can bind you to a precise Python version."
msgstr ""

#: ../../c-api/code.rst:44
Expand All @@ -82,9 +82,9 @@ msgstr ""

#: ../../c-api/code.rst:61
msgid ""
"Similar to :c:func:`PyCode_New`, but with an extra \"posonlyargcount\" for "
"positional-only arguments. The same caveats that apply to ``PyCode_New`` "
"also apply to this function."
"Similar to :c:func:`PyUnstable_Code_New`, but with an extra "
"\"posonlyargcount\" for positional-only arguments. The same caveats that "
"apply to ``PyUnstable_Code_New`` also apply to this function."
msgstr ""

#: ../../c-api/code.rst:66
Expand Down
6 changes: 3 additions & 3 deletions c-api/codec.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-26 16:47+0000\n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"PO-Revision-Date: 2023-07-24 17:51+0000\n"
"Last-Translator: Matt Wang <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand All @@ -28,10 +28,10 @@ msgstr "註冊一個新的編解碼器搜索函式。"

#: ../../c-api/codec.rst:10
msgid ""
"As side effect, this tries to load the :mod:`encodings` package, if not yet "
"As side effect, this tries to load the :mod:`!encodings` package, if not yet "
"done, to make sure that it is always first in the list of search functions."
msgstr ""
"作為副作用 (side effect),這會嘗試載入 :mod:`encodings`\\ (如果尚未完成),"
"作為副作用 (side effect),這會嘗試載入 :mod:`!encodings`\\ (如果尚未完成),"
"以確保它始終位於搜索函式列表中的第一個。"

#: ../../c-api/codec.rst:15
Expand Down
Loading