diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index dae76878a3..a6bd32c1cd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,8 +9,15 @@ jobs:
steps:
- uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.13"
+
- name: Install Dependencies
run: sudo apt-get install gettext
+ - name: Install uv
+ uses: astral-sh/setup-uv@v6
+
- name: Validate
run: VERSION=${{ github.event.repository.default_branch }} JOBS=4 MODE=html make all
diff --git a/.github/workflows/deploy-gh-page.yml b/.github/workflows/deploy-gh-page.yml
index f969970078..2c7442c1a8 100644
--- a/.github/workflows/deploy-gh-page.yml
+++ b/.github/workflows/deploy-gh-page.yml
@@ -14,11 +14,14 @@ jobs:
- name: Install Dependencies
run: sudo apt-get install gettext
+ - name: Install uv
+ uses: astral-sh/setup-uv@v6
+
- name: Build
run: JOBS=4 MODE=html make all
- name: Deploy to gh page
- uses: JamesIves/github-pages-deploy-action@v4.7.2
+ uses: JamesIves/github-pages-deploy-action@v4.7.3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
diff --git a/.github/workflows/py313-sync-cpython.yml b/.github/workflows/py313-sync-cpython.yml
index 9305dbc4b2..f3362c52c5 100644
--- a/.github/workflows/py313-sync-cpython.yml
+++ b/.github/workflows/py313-sync-cpython.yml
@@ -30,8 +30,11 @@ jobs:
- name: Install Dependencies
run: sudo apt-get install gettext
+ - name: Install uv
+ uses: astral-sh/setup-uv@v6
+
- name: Sync with CPython
- run: make clone && make merge && make rm_cpython
+ run: make clone merge rm_cpython wrap
- uses: tibdex/github-app-token@v2
id: generate-token
diff --git a/.github/workflows/summarize_progress.yml b/.github/workflows/summarize_progress.yml
index 3ffccb41a9..c13a205ad5 100644
--- a/.github/workflows/summarize_progress.yml
+++ b/.github/workflows/summarize_progress.yml
@@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install poetry
- uses: abatilo/actions-poetry@v3
+ uses: abatilo/actions-poetry@v4
- name: Execute Check Process
run: |
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7cf6db96a6..33a264ab44 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -7,6 +7,6 @@
repos:
- repo: https://git.afpy.org/AFPy/powrap
# there's no release tag in repo, use the latest commit hash id instead
- rev: a34a9fed116d24562fbe4bb8d456ade85f056c36
+ rev: v1.0.2
hooks:
- id: powrap
\ No newline at end of file
diff --git a/Makefile b/Makefile
index f255eb901d..c0da35f4af 100644
--- a/Makefile
+++ b/Makefile
@@ -89,21 +89,21 @@ prepare_cpython: ## Prepare CPython clone at `../cpython/`.
$(VENV)/bin/activate:
- python3 -m venv $(VENV)
+ uv venv $(VENV)
$(VENV)/bin/sphinx-build: $(VENV)/bin/activate
- . $(VENV)/bin/activate; python3 -m pip install sphinx python-docs-theme
+ . $(VENV)/bin/activate; uv pip install sphinx python-docs-theme
$(VENV)/bin/sphinx-lint: $(VENV)/bin/activate
- . $(VENV)/bin/activate; python3 -m pip install sphinx-lint
+ . $(VENV)/bin/activate; uv pip install sphinx-lint
$(VENV)/bin/blurb: $(VENV)/bin/activate
- . $(VENV)/bin/activate; python3 -m pip install blurb
+ . $(VENV)/bin/activate; uv pip install blurb
.PHONY: upgrade_venv
upgrade_venv: $(VENV)/bin/activate ## Upgrade the venv that compiles the doc
- @. $(VENV)/bin/activate; python3 -m pip install -q --upgrade sphinx python-docs-theme blurb sphinx-lint
+ @. $(VENV)/bin/activate; uv pip install -q --upgrade sphinx python-docs-theme blurb sphinx-lint
.PHONY: progress
@@ -156,6 +156,10 @@ rm_cpython: ## Remove cloned cpython repo
lint: $(VENV)/bin/sphinx-lint ## Run sphinx-lint
$(VENV)/bin/sphinx-lint --enable default-role
+.PHONY: wrap
+wrap: ## Run powrap on modified po files
+ uvx powrap --modified
+
# This allows us to accept extra arguments (by doing nothing when we get a job that doesn't match, rather than throwing an error)
%:
@:
diff --git a/README.rst b/README.rst
index c239b4a89a..4a5fcd7f1e 100644
--- a/README.rst
+++ b/README.rst
@@ -84,6 +84,7 @@ the PSF for inclusion in the documentation.
- `安裝好 git `_\ (Windows
上請參考 https://gitforwindows.org/)
- 一個 ``.po`` 檔的編輯器。推薦使用 `Poedit `_,若熟悉 po 檔用一般文字編輯器亦可。
+- 參考 `uv Installation `_ 安裝 uv,以便在本機端預覽翻譯成果。
- macOS 的使用者還需要先利用 `homebrew `_ 安裝 gettext,屆時 Sphinx 會使用到。
.. code-block:: bash
@@ -232,7 +233,7 @@ the PSF for inclusion in the documentation.
其中最簡單的貢獻方式就是更新 *fuzzy entries*,讓曾經翻譯的內容保持與最新版本的文件
同步。請參考\ `尋找有翻譯過但需校閱的 fuzzy entries`_ 段落。
-此外,當前的目標為完成 **Tutorial** 的翻譯,因此在 ``tutorial/`` 底下的所有
+此外,目前的目標為完成 **Tutorial** 的翻譯,因此在 ``tutorial/`` 底下的所有
po 檔皆為首要的翻譯對象。你也可以幫忙校對已經翻譯過的內容。
diff --git a/c-api/allocation.po b/c-api/allocation.po
index 2d4ce8e20a..28435d6916 100644
--- a/c-api/allocation.po
+++ b/c-api/allocation.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-11-06 00:13+0000\n"
+"POT-Creation-Date: 2025-03-18 00:14+0000\n"
"PO-Revision-Date: 2022-10-16 15:35+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -56,7 +56,14 @@ msgstr ""
"化;呼叫者會擁有那個對於物件的唯一參照(物件的參照計數為一)。記憶體分配大小"
"由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位來指定。"
-#: ../../c-api/allocation.rst:41
+#: ../../c-api/allocation.rst:38
+msgid ""
+"Note that this function is unsuitable if *typeobj* has :c:macro:"
+"`Py_TPFLAGS_HAVE_GC` set. For such objects, use :c:func:`PyObject_GC_New` "
+"instead."
+msgstr ""
+
+#: ../../c-api/allocation.rst:45
msgid ""
"Allocate a new Python object using the C structure type *TYPE* and the "
"Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the "
@@ -75,7 +82,14 @@ msgstr ""
"於實現如 tuple 這種能夠在建立期間決定自己大小的物件是很實用的。將欄位的陣列嵌"
"入到相同的記憶體分配中可以減少記憶體分配的次數,這提高了記憶體管理的效率。"
-#: ../../c-api/allocation.rst:55
+#: ../../c-api/allocation.rst:56
+msgid ""
+"Note that this function is unsuitable if *typeobj* has :c:macro:"
+"`Py_TPFLAGS_HAVE_GC` set. For such objects, use :c:func:`PyObject_GC_NewVar` "
+"instead."
+msgstr ""
+
+#: ../../c-api/allocation.rst:63
msgid ""
"Releases memory allocated to an object using :c:macro:`PyObject_New` or :c:"
"macro:`PyObject_NewVar`. This is normally called from the :c:member:"
@@ -88,7 +102,7 @@ msgstr ""
"handler 中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的"
"記憶體已不再是一個有效的 Python 物件。"
-#: ../../c-api/allocation.rst:64
+#: ../../c-api/allocation.rst:72
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 "
@@ -97,10 +111,10 @@ msgstr ""
"這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存"
"取,該巨集的拿到指向該物件的指標。"
-#: ../../c-api/allocation.rst:71
+#: ../../c-api/allocation.rst:79
msgid ":c:func:`PyModule_Create`"
msgstr ":c:func:`PyModule_Create`"
-#: ../../c-api/allocation.rst:72
+#: ../../c-api/allocation.rst:80
msgid "To allocate and create extension modules."
msgstr "分配記憶體和建立擴充模組。"
diff --git a/c-api/arg.po b/c-api/arg.po
index 7d0ae25460..921b3bae7f 100644
--- a/c-api/arg.po
+++ b/c-api/arg.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-01-07 00:14+0000\n"
+"POT-Creation-Date: 2025-05-06 05:40+0000\n"
"PO-Revision-Date: 2022-10-16 03:21+0800\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -24,18 +24,18 @@ msgstr "剖析引數與建置數值"
#: ../../c-api/arg.rst:8
msgid ""
-"These functions are useful when creating your own extensions functions and "
-"methods. Additional information and examples are available "
-"in :ref:`extending-index`."
+"These functions are useful when creating your own extension functions and "
+"methods. Additional information and examples are available in :ref:"
+"`extending-index`."
msgstr ""
#: ../../c-api/arg.rst:12
msgid ""
-"The first three of these functions "
-"described, :c:func:`PyArg_ParseTuple`, :c:func:`PyArg_ParseTupleAndKeywords`, "
-"and :c:func:`PyArg_Parse`, all use *format strings* which are used to tell "
-"the function about the expected arguments. The format strings use the same "
-"syntax for each of these functions."
+"The first three of these functions described, :c:func:`PyArg_ParseTuple`, :c:"
+"func:`PyArg_ParseTupleAndKeywords`, and :c:func:`PyArg_Parse`, all use "
+"*format strings* which are used to tell the function about the expected "
+"arguments. The format strings use the same syntax for each of these "
+"functions."
msgstr ""
#: ../../c-api/arg.rst:19
@@ -108,10 +108,10 @@ msgstr ""
#: ../../c-api/arg.rst:70
msgid ""
-"To ensure that the underlying buffer may be safely borrowed, the "
-"object's :c:member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. "
-"This disallows common mutable objects such as :class:`bytearray`, but also "
-"some read-only objects such as :class:`memoryview` of :class:`bytes`."
+"To ensure that the underlying buffer may be safely borrowed, the object's :c:"
+"member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. This "
+"disallows common mutable objects such as :class:`bytearray`, but also some "
+"read-only objects such as :class:`memoryview` of :class:`bytes`."
msgstr ""
#: ../../c-api/arg.rst:76
@@ -139,8 +139,8 @@ msgstr ""
msgid ""
"This format does not accept :term:`bytes-like objects `. "
"If you want to accept filesystem paths and convert them to C character "
-"strings, it is preferable to use the ``O&`` format "
-"with :c:func:`PyUnicode_FSConverter` as *converter*."
+"strings, it is preferable to use the ``O&`` format with :c:func:"
+"`PyUnicode_FSConverter` as *converter*."
msgstr ""
#: ../../c-api/arg.rst:96
@@ -163,11 +163,11 @@ msgstr ""
#: ../../c-api/arg.rst:106
msgid ""
-"``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char "
-"\\*, :c:type:`Py_ssize_t`]"
+"``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char \\*, :"
+"c:type:`Py_ssize_t`]"
msgstr ""
-"``s#`` (:class:`str`、唯讀的 :term:`bytes-like object`) [const char "
-"\\*, :c:type:`Py_ssize_t`]"
+"``s#`` (:class:`str`、唯讀的 :term:`bytes-like object`) [const char \\*, :c:"
+"type:`Py_ssize_t`]"
#: ../../c-api/arg.rst:107
msgid ""
@@ -244,11 +244,11 @@ msgstr ""
#: ../../c-api/arg.rst:141
msgid ""
-"``y#`` (read-only :term:`bytes-like object`) [const char "
-"\\*, :c:type:`Py_ssize_t`]"
+"``y#`` (read-only :term:`bytes-like object`) [const char \\*, :c:type:"
+"`Py_ssize_t`]"
msgstr ""
-"``y#`` (唯讀的 :term:`bytes-like object`) [const char "
-"\\*, :c:type:`Py_ssize_t`]"
+"``y#`` (唯讀的 :term:`bytes-like object`) [const char \\*, :c:type:"
+"`Py_ssize_t`]"
#: ../../c-api/arg.rst:142
msgid ""
@@ -274,9 +274,9 @@ msgstr "``Y`` (:class:`bytearray`) [PyByteArrayObject \\*]"
#: ../../c-api/arg.rst:151
msgid ""
"Requires that the Python object is a :class:`bytearray` object, without "
-"attempting any conversion. Raises :exc:`TypeError` if the object is not "
-"a :class:`bytearray` object. The C variable may also be declared "
-"as :c:expr:`PyObject*`."
+"attempting any conversion. Raises :exc:`TypeError` if the object is not a :"
+"class:`bytearray` object. The C variable may also be declared as :c:expr:"
+"`PyObject*`."
msgstr ""
#: ../../c-api/arg.rst:155
@@ -298,8 +298,8 @@ msgstr "``w*`` (可讀寫 :term:`bytes-like object`) [Py_buffer]"
msgid ""
"This format accepts any object which implements the read-write buffer "
"interface. It fills a :c:type:`Py_buffer` structure provided by the caller. "
-"The buffer may contain embedded null bytes. The caller have to "
-"call :c:func:`PyBuffer_Release` when it is done with the buffer."
+"The buffer may contain embedded null bytes. The caller have to call :c:func:"
+"`PyBuffer_Release` when it is done with the buffer."
msgstr ""
#: ../../c-api/arg.rst:166
@@ -327,8 +327,8 @@ msgstr ""
msgid ""
":c:func:`PyArg_ParseTuple` will allocate a buffer of the needed size, copy "
"the encoded data into this buffer and adjust *\\*buffer* to reference the "
-"newly allocated storage. The caller is responsible for "
-"calling :c:func:`PyMem_Free` to free the allocated buffer after use."
+"newly allocated storage. The caller is responsible for calling :c:func:"
+"`PyMem_Free` to free the allocated buffer after use."
msgstr ""
#: ../../c-api/arg.rst:183
@@ -348,11 +348,11 @@ msgstr ""
#: ../../c-api/arg.rst:188
msgid ""
-"``es#`` (:class:`str`) [const char \\*encoding, char "
-"\\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]"
+"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, :c:type:"
+"`Py_ssize_t` \\*buffer_length]"
msgstr ""
-"``es#`` (:class:`str`) [const char \\*encoding, char "
-"\\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]"
+"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, :c:type:"
+"`Py_ssize_t` \\*buffer_length]"
#: ../../c-api/arg.rst:189
msgid ""
@@ -428,11 +428,10 @@ msgstr "數字"
#: ../../c-api/arg.rst:232
msgid ""
"These formats allow representing Python numbers or single characters as C "
-"numbers. Formats that require :class:`int`, :class:`float` "
-"or :class:`complex` can also use the corresponding special "
-"methods :meth:`~object.__index__`, :meth:`~object.__float__` "
-"or :meth:`~object.__complex__` to convert the Python object to the required "
-"type."
+"numbers. Formats that require :class:`int`, :class:`float` or :class:"
+"`complex` can also use the corresponding special methods :meth:`~object."
+"__index__`, :meth:`~object.__float__` or :meth:`~object.__complex__` to "
+"convert the Python object to the required type."
msgstr ""
#: ../../c-api/arg.rst:238
@@ -452,8 +451,8 @@ msgid ""
"Convert a nonnegative Python integer to an unsigned tiny integer, stored in "
"a C :c:expr:`unsigned char`."
msgstr ""
-"將一個 Python 非負整數轉換成無符號 tiny integer(小整數),儲存在 C "
-"的 :c:expr:`unsigned`"
+"將一個 Python 非負整數轉換成無符號 tiny integer(小整數),儲存在 C 的 :c:"
+"expr:`unsigned`"
#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:627
msgid "``B`` (:class:`int`) [unsigned char]"
@@ -464,8 +463,8 @@ msgid ""
"Convert a Python integer to a tiny integer without overflow checking, stored "
"in a C :c:expr:`unsigned char`."
msgstr ""
-"將一個 Python 整數轉換成 tiny integer,轉換過程無溢位檢查,儲存在 C "
-"的 :c:expr:`unsigned char`。"
+"將一個 Python 整數轉換成 tiny integer,轉換過程無溢位檢查,儲存在 C 的 :c:"
+"expr:`unsigned char`。"
#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:621
msgid "``h`` (:class:`int`) [short int]"
@@ -533,7 +532,7 @@ msgstr "``L`` (:class:`int`) [long long]"
msgid "Convert a Python integer to a C :c:expr:`long long`."
msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long long`。"
-#: ../../c-api/arg.rst:276 ../../c-api/arg.rst:642
+#: ../../c-api/arg.rst:276 ../../c-api/arg.rst:644
msgid "``K`` (:class:`int`) [unsigned long long]"
msgstr "``K`` (:class:`int`) [unsigned long long]"
@@ -545,7 +544,7 @@ msgstr ""
"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long long`,轉換過程無溢位檢"
"查。"
-#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:645
+#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:647
msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]"
msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]"
@@ -567,7 +566,7 @@ msgstr ""
msgid "Allow :class:`bytearray` objects."
msgstr "允許 :class:`bytearray` 物件。"
-#: ../../c-api/arg.rst:290 ../../c-api/arg.rst:652
+#: ../../c-api/arg.rst:290 ../../c-api/arg.rst:654
msgid "``C`` (:class:`str` of length 1) [int]"
msgstr "``C`` (長度為 1 的 :class:`str`) [int]"
@@ -577,7 +576,7 @@ msgid ""
"1, to a C :c:expr:`int`."
msgstr ""
-#: ../../c-api/arg.rst:294 ../../c-api/arg.rst:659
+#: ../../c-api/arg.rst:294 ../../c-api/arg.rst:661
msgid "``f`` (:class:`float`) [float]"
msgstr "``f`` (:class:`float`) [float]"
@@ -585,7 +584,7 @@ msgstr "``f`` (:class:`float`) [float]"
msgid "Convert a Python floating-point number to a C :c:expr:`float`."
msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`float`。"
-#: ../../c-api/arg.rst:297 ../../c-api/arg.rst:656
+#: ../../c-api/arg.rst:297 ../../c-api/arg.rst:658
msgid "``d`` (:class:`float`) [double]"
msgstr "``d`` (:class:`float`) [double]"
@@ -605,16 +604,16 @@ msgstr "將一個 Python 複數轉換成 C 的 :c:type:`Py_complex` 結構。"
msgid "Other objects"
msgstr "其他物件"
-#: ../../c-api/arg.rst:306 ../../c-api/arg.rst:665
+#: ../../c-api/arg.rst:306 ../../c-api/arg.rst:667
msgid "``O`` (object) [PyObject \\*]"
msgstr "``O`` (object) [PyObject \\*]"
#: ../../c-api/arg.rst:307
msgid ""
"Store a Python object (without any conversion) in a C object pointer. The C "
-"program thus receives the actual object that was passed. A "
-"new :term:`strong reference` to the object is not created (i.e. its "
-"reference count is not increased). The pointer stored is not ``NULL``."
+"program thus receives the actual object that was passed. A new :term:"
+"`strong reference` to the object is not created (i.e. its reference count is "
+"not increased). The pointer stored is not ``NULL``."
msgstr ""
#: ../../c-api/arg.rst:313
@@ -648,12 +647,12 @@ msgstr "status = converter(object, address);"
#: ../../c-api/arg.rst:330
msgid ""
-"where *object* is the Python object to be converted and *address* is "
-"the :c:expr:`void*` argument that was passed to the ``PyArg_Parse*`` "
-"function. The returned *status* should be ``1`` for a successful conversion "
-"and ``0`` if the conversion has failed. When the conversion fails, the "
-"*converter* function should raise an exception and leave the content of "
-"*address* unmodified."
+"where *object* is the Python object to be converted and *address* is the :c:"
+"expr:`void*` argument that was passed to the ``PyArg_Parse*`` function. The "
+"returned *status* should be ``1`` for a successful conversion and ``0`` if "
+"the conversion has failed. When the conversion fails, the *converter* "
+"function should raise an exception and leave the content of *address* "
+"unmodified."
msgstr ""
#: ../../c-api/arg.rst:339
@@ -667,8 +666,8 @@ msgstr ""
#: ../../c-api/arg.rst:345
msgid ""
-"Examples of converters: :c:func:`PyUnicode_FSConverter` "
-"and :c:func:`PyUnicode_FSDecoder`."
+"Examples of converters: :c:func:`PyUnicode_FSConverter` and :c:func:"
+"`PyUnicode_FSDecoder`."
msgstr ""
#: ../../c-api/arg.rst:348
@@ -688,7 +687,7 @@ msgid ""
"how Python tests values for truth."
msgstr ""
-#: ../../c-api/arg.rst:360 ../../c-api/arg.rst:689
+#: ../../c-api/arg.rst:360 ../../c-api/arg.rst:691
msgid "``(items)`` (:class:`tuple`) [*matching-items*]"
msgstr "``(items)`` (:class:`tuple`) [*matching-items*]"
@@ -748,8 +747,8 @@ msgstr "``;``"
#: ../../c-api/arg.rst:390
msgid ""
"The list of format units ends here; the string after the semicolon is used "
-"as the error message *instead* of the default error message. ``:`` and "
-"``;`` mutually exclude each other."
+"as the error message *instead* of the default error message. ``:`` and ``;"
+"`` mutually exclude each other."
msgstr ""
#: ../../c-api/arg.rst:394
@@ -808,9 +807,9 @@ msgstr ""
#: ../../c-api/arg.rst:441
msgid ""
-"The *keywords* parameter declaration is :c:expr:`char * const *` in C "
-"and :c:expr:`const char * const *` in C++. This can be overridden with "
-"the :c:macro:`PY_CXX_CONST` macro."
+"The *keywords* parameter declaration is :c:expr:`char * const *` in C and :c:"
+"expr:`const char * const *` in C++. This can be overridden with the :c:macro:"
+"`PY_CXX_CONST` macro."
msgstr ""
#: ../../c-api/arg.rst:445
@@ -821,9 +820,9 @@ msgstr "新增對\\ :ref:`僅限位置參數 `\\ 的
#: ../../c-api/arg.rst:449
msgid ""
-"The *keywords* parameter has now type :c:expr:`char * const *` in C "
-"and :c:expr:`const char * const *` in C++, instead of :c:expr:`char **`. "
-"Added support for non-ASCII keyword parameter names."
+"The *keywords* parameter has now type :c:expr:`char * const *` in C and :c:"
+"expr:`const char * const *` in C++, instead of :c:expr:`char **`. Added "
+"support for non-ASCII keyword parameter names."
msgstr ""
#: ../../c-api/arg.rst:458
@@ -961,10 +960,10 @@ msgid ""
"When memory buffers are passed as parameters to supply data to build "
"objects, as for the ``s`` and ``s#`` formats, the required data is copied. "
"Buffers provided by the caller are never referenced by the objects created "
-"by :c:func:`Py_BuildValue`. In other words, if your code "
-"invokes :c:func:`malloc` and passes the allocated memory "
-"to :c:func:`Py_BuildValue`, your code is responsible for "
-"calling :c:func:`free` for that memory once :c:func:`Py_BuildValue` returns."
+"by :c:func:`Py_BuildValue`. In other words, if your code invokes :c:func:"
+"`malloc` and passes the allocated memory to :c:func:`Py_BuildValue`, your "
+"code is responsible for calling :c:func:`free` for that memory once :c:func:"
+"`Py_BuildValue` returns."
msgstr ""
#: ../../c-api/arg.rst:568
@@ -1111,125 +1110,125 @@ msgstr "將一個 C 的 :c:expr:`unsigned long` 轉換成 Python 整數物件。
msgid "Convert a C :c:expr:`long long` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`long long` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:643
+#: ../../c-api/arg.rst:645
msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`unsigned long long` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:646
+#: ../../c-api/arg.rst:648
msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer."
msgstr "將一個 C 的 :c:type:`Py_ssize_t` 轉換成 Python 整數。"
-#: ../../c-api/arg.rst:648
+#: ../../c-api/arg.rst:650
msgid "``c`` (:class:`bytes` of length 1) [char]"
msgstr "``c`` (長度為 1 的 :class:`bytes`) [char]"
-#: ../../c-api/arg.rst:649
+#: ../../c-api/arg.rst:651
msgid ""
"Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` "
"object of length 1."
msgstr ""
-"將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一"
-"的 :class:`bytes`。"
+"將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:"
+"`bytes`。"
-#: ../../c-api/arg.rst:653
+#: ../../c-api/arg.rst:655
msgid ""
"Convert a C :c:expr:`int` representing a character to Python :class:`str` "
"object of length 1."
msgstr ""
-"將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一"
-"的 :class:`str`。"
+"將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:"
+"`str`。"
-#: ../../c-api/arg.rst:657
+#: ../../c-api/arg.rst:659
msgid "Convert a C :c:expr:`double` to a Python floating-point number."
msgstr "將一個 C 的 :c:expr:`double` 轉換成 Python 浮點數。"
-#: ../../c-api/arg.rst:660
+#: ../../c-api/arg.rst:662
msgid "Convert a C :c:expr:`float` to a Python floating-point number."
msgstr "將一個 C 的 :c:expr:`float` 轉換成 Python 浮點數。"
-#: ../../c-api/arg.rst:662
+#: ../../c-api/arg.rst:664
msgid "``D`` (:class:`complex`) [Py_complex \\*]"
msgstr "``D`` (:class:`complex`) [Py_complex \\*]"
-#: ../../c-api/arg.rst:663
+#: ../../c-api/arg.rst:665
msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number."
msgstr "將一個 C 的 :c:type:`Py_complex` 結構轉換成 Python 複數。"
-#: ../../c-api/arg.rst:666
+#: ../../c-api/arg.rst:668
msgid ""
"Pass a Python object untouched but create a new :term:`strong reference` to "
"it (i.e. its reference count is incremented by one). If the object passed in "
"is a ``NULL`` pointer, it is assumed that this was caused because the call "
-"producing the argument found an error and set an exception. "
-"Therefore, :c:func:`Py_BuildValue` will return ``NULL`` but won't raise an "
-"exception. If no exception has been raised yet, :exc:`SystemError` is set."
+"producing the argument found an error and set an exception. Therefore, :c:"
+"func:`Py_BuildValue` will return ``NULL`` but won't raise an exception. If "
+"no exception has been raised yet, :exc:`SystemError` is set."
msgstr ""
-#: ../../c-api/arg.rst:675
+#: ../../c-api/arg.rst:677
msgid "``S`` (object) [PyObject \\*]"
msgstr "``S`` (object) [PyObject \\*]"
-#: ../../c-api/arg.rst:676
+#: ../../c-api/arg.rst:678
msgid "Same as ``O``."
msgstr "和 ``O`` 相同。"
-#: ../../c-api/arg.rst:678
+#: ../../c-api/arg.rst:680
msgid "``N`` (object) [PyObject \\*]"
msgstr "``N`` (object) [PyObject \\*]"
-#: ../../c-api/arg.rst:679
+#: ../../c-api/arg.rst:681
msgid ""
"Same as ``O``, except it doesn't create a new :term:`strong reference`. "
"Useful when the object is created by a call to an object constructor in the "
"argument list."
msgstr ""
-#: ../../c-api/arg.rst:683
+#: ../../c-api/arg.rst:685
msgid "``O&`` (object) [*converter*, *anything*]"
msgstr "``O&`` (object) [*converter*, *anything*]"
-#: ../../c-api/arg.rst:684
+#: ../../c-api/arg.rst:686
msgid ""
"Convert *anything* to a Python object through a *converter* function. The "
-"function is called with *anything* (which should be compatible "
-"with :c:expr:`void*`) as its argument and should return a \"new\" Python "
-"object, or ``NULL`` if an error occurred."
+"function is called with *anything* (which should be compatible with :c:expr:"
+"`void*`) as its argument and should return a \"new\" Python object, or "
+"``NULL`` if an error occurred."
msgstr ""
-#: ../../c-api/arg.rst:690
+#: ../../c-api/arg.rst:692
msgid ""
"Convert a sequence of C values to a Python tuple with the same number of "
"items."
msgstr ""
-#: ../../c-api/arg.rst:692
+#: ../../c-api/arg.rst:694
msgid "``[items]`` (:class:`list`) [*matching-items*]"
msgstr "``[items]`` (:class:`list`) [*matching-items*]"
-#: ../../c-api/arg.rst:693
+#: ../../c-api/arg.rst:695
msgid ""
"Convert a sequence of C values to a Python list with the same number of "
"items."
msgstr ""
-#: ../../c-api/arg.rst:695
+#: ../../c-api/arg.rst:697
msgid "``{items}`` (:class:`dict`) [*matching-items*]"
msgstr "``{items}`` (:class:`dict`) [*matching-items*]"
-#: ../../c-api/arg.rst:696
+#: ../../c-api/arg.rst:698
msgid ""
"Convert a sequence of C values to a Python dictionary. Each pair of "
"consecutive C values adds one item to the dictionary, serving as key and "
"value, respectively."
msgstr ""
-#: ../../c-api/arg.rst:700
+#: ../../c-api/arg.rst:702
msgid ""
"If there is an error in the format string, the :exc:`SystemError` exception "
"is set and ``NULL`` returned."
msgstr ""
-#: ../../c-api/arg.rst:705
+#: ../../c-api/arg.rst:707
msgid ""
"Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list "
"rather than a variable number of arguments."
diff --git a/c-api/buffer.po b/c-api/buffer.po
index d183ac606f..5248994757 100644
--- a/c-api/buffer.po
+++ b/c-api/buffer.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-24 23:08+0000\n"
+"POT-Creation-Date: 2025-05-02 00:15+0000\n"
"PO-Revision-Date: 2018-05-23 14:30+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -41,24 +41,26 @@ msgstr ""
#: ../../c-api/buffer.rst:29
msgid ""
-"Python provides such a facility at the C level in the form of the :ref:"
-"`buffer protocol `. This protocol has two sides:"
+"Python provides such a facility at the C and Python level in the form of "
+"the :ref:`buffer protocol `. This protocol has two sides:"
msgstr ""
#: ../../c-api/buffer.rst:34
msgid ""
"on the producer side, a type can export a \"buffer interface\" which allows "
"objects of that type to expose information about their underlying buffer. "
-"This interface is described in the section :ref:`buffer-structs`;"
+"This interface is described in the section :ref:`buffer-structs`; for Python "
+"see :ref:`python-buffer-protocol`."
msgstr ""
-#: ../../c-api/buffer.rst:38
+#: ../../c-api/buffer.rst:39
msgid ""
"on the consumer side, several means are available to obtain a pointer to the "
-"raw underlying data of an object (for example a method parameter)."
+"raw underlying data of an object (for example a method parameter). For "
+"Python see :class:`memoryview`."
msgstr ""
-#: ../../c-api/buffer.rst:41
+#: ../../c-api/buffer.rst:43
msgid ""
"Simple objects such as :class:`bytes` and :class:`bytearray` expose their "
"underlying buffer in byte-oriented form. Other forms are possible; for "
@@ -66,7 +68,7 @@ msgid ""
"values."
msgstr ""
-#: ../../c-api/buffer.rst:45
+#: ../../c-api/buffer.rst:47
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 "
@@ -78,23 +80,23 @@ msgid ""
"buffers."
msgstr ""
-#: ../../c-api/buffer.rst:53
+#: ../../c-api/buffer.rst:55
msgid ""
"There are two ways for a consumer of the buffer interface to acquire a "
"buffer over a target object:"
msgstr ""
-#: ../../c-api/buffer.rst:56
+#: ../../c-api/buffer.rst:58
msgid "call :c:func:`PyObject_GetBuffer` with the right parameters;"
msgstr ""
-#: ../../c-api/buffer.rst:58
+#: ../../c-api/buffer.rst:60
msgid ""
"call :c:func:`PyArg_ParseTuple` (or one of its siblings) with one of the "
"``y*``, ``w*`` or ``s*`` :ref:`format codes `."
msgstr ""
-#: ../../c-api/buffer.rst:61
+#: ../../c-api/buffer.rst:63
msgid ""
"In both cases, :c:func:`PyBuffer_Release` must be called when the buffer "
"isn't needed anymore. Failure to do so could lead to various issues such as "
@@ -102,10 +104,16 @@ msgid ""
msgstr ""
#: ../../c-api/buffer.rst:69
+msgid ""
+"The buffer protocol is now accessible in Python, see :ref:`python-buffer-"
+"protocol` and :class:`memoryview`."
+msgstr ""
+
+#: ../../c-api/buffer.rst:75
msgid "Buffer structure"
msgstr ""
-#: ../../c-api/buffer.rst:71
+#: ../../c-api/buffer.rst:77
msgid ""
"Buffer structures (or simply \"buffers\") are useful as a way to expose the "
"binary data from another object to the Python programmer. They can also be "
@@ -117,7 +125,7 @@ msgid ""
"in its native, in-memory format."
msgstr ""
-#: ../../c-api/buffer.rst:80
+#: ../../c-api/buffer.rst:86
msgid ""
"Contrary to most data types exposed by the Python interpreter, buffers are "
"not :c:type:`PyObject` pointers but rather simple C structures. This allows "
@@ -126,14 +134,14 @@ msgid ""
"created."
msgstr ""
-#: ../../c-api/buffer.rst:86
+#: ../../c-api/buffer.rst:92
msgid ""
"For short instructions how to write an exporting object, see :ref:`Buffer "
"Object Structures `. For obtaining a buffer, see :c:func:"
"`PyObject_GetBuffer`."
msgstr ""
-#: ../../c-api/buffer.rst:94
+#: ../../c-api/buffer.rst:100
msgid ""
"A pointer to the start of the logical structure described by the buffer "
"fields. This can be any location within the underlying physical memory block "
@@ -141,13 +149,13 @@ msgid ""
"the value may point to the end of the memory block."
msgstr ""
-#: ../../c-api/buffer.rst:99
+#: ../../c-api/buffer.rst:105
msgid ""
"For :term:`contiguous` arrays, the value points to the beginning of the "
"memory block."
msgstr ""
-#: ../../c-api/buffer.rst:104
+#: ../../c-api/buffer.rst:110
msgid ""
"A new reference to the exporting object. The reference is owned by the "
"consumer and automatically released (i.e. reference count decremented) and "
@@ -155,14 +163,14 @@ msgid ""
"of the return value of any standard C-API function."
msgstr ""
-#: ../../c-api/buffer.rst:111
+#: ../../c-api/buffer.rst:117
msgid ""
"As a special case, for *temporary* buffers that are wrapped by :c:func:"
"`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this field is "
"``NULL``. In general, exporting objects MUST NOT use this scheme."
msgstr ""
-#: ../../c-api/buffer.rst:118
+#: ../../c-api/buffer.rst:124
msgid ""
"``product(shape) * itemsize``. For contiguous arrays, this is the length of "
"the underlying memory block. For non-contiguous arrays, it is the length "
@@ -170,7 +178,7 @@ msgid ""
"representation."
msgstr ""
-#: ../../c-api/buffer.rst:123
+#: ../../c-api/buffer.rst:129
msgid ""
"Accessing ``((char *)buf)[0] up to ((char *)buf)[len-1]`` is only valid if "
"the buffer has been obtained by a request that guarantees contiguity. In "
@@ -178,19 +186,19 @@ msgid ""
"`PyBUF_WRITABLE`."
msgstr ""
-#: ../../c-api/buffer.rst:129
+#: ../../c-api/buffer.rst:135
msgid ""
"An indicator of whether the buffer is read-only. This field is controlled by "
"the :c:macro:`PyBUF_WRITABLE` flag."
msgstr ""
-#: ../../c-api/buffer.rst:134
+#: ../../c-api/buffer.rst:140
msgid ""
"Item size in bytes of a single element. Same as the value of :func:`struct."
"calcsize` called on non-``NULL`` :c:member:`~Py_buffer.format` values."
msgstr ""
-#: ../../c-api/buffer.rst:137
+#: ../../c-api/buffer.rst:143
msgid ""
"Important exception: If a consumer requests a buffer without the :c:macro:"
"`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will be set to "
@@ -198,32 +206,32 @@ msgid ""
"original format."
msgstr ""
-#: ../../c-api/buffer.rst:142
+#: ../../c-api/buffer.rst:148
msgid ""
"If :c:member:`~Py_buffer.shape` is present, the equality ``product(shape) * "
"itemsize == len`` still holds and the consumer can use :c:member:`~Py_buffer."
"itemsize` to navigate the buffer."
msgstr ""
-#: ../../c-api/buffer.rst:146
+#: ../../c-api/buffer.rst:152
msgid ""
"If :c:member:`~Py_buffer.shape` is ``NULL`` as a result of a :c:macro:"
"`PyBUF_SIMPLE` or a :c:macro:`PyBUF_WRITABLE` request, the consumer must "
"disregard :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``."
msgstr ""
-#: ../../c-api/buffer.rst:152
+#: ../../c-api/buffer.rst:158
msgid ""
"A *NULL* terminated string in :mod:`struct` module style syntax describing "
"the contents of a single item. If this is ``NULL``, ``\"B\"`` (unsigned "
"bytes) is assumed."
msgstr ""
-#: ../../c-api/buffer.rst:156
+#: ../../c-api/buffer.rst:162
msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag."
msgstr ""
-#: ../../c-api/buffer.rst:160
+#: ../../c-api/buffer.rst:166
msgid ""
"The number of dimensions the memory represents as an n-dimensional array. If "
"it is ``0``, :c:member:`~Py_buffer.buf` points to a single item representing "
@@ -232,7 +240,7 @@ msgid ""
"number of dimensions is given by :c:macro:`PyBUF_MAX_NDIM`."
msgstr ""
-#: ../../c-api/buffer.rst:168
+#: ../../c-api/buffer.rst:174
msgid ""
"An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` "
"indicating the shape of the memory as an n-dimensional array. Note that "
@@ -240,34 +248,34 @@ msgid ""
"`~Py_buffer.len`."
msgstr ""
-#: ../../c-api/buffer.rst:173
+#: ../../c-api/buffer.rst:179
msgid ""
"Shape values are restricted to ``shape[n] >= 0``. The case ``shape[n] == 0`` "
"requires special attention. See `complex arrays`_ for further information."
msgstr ""
-#: ../../c-api/buffer.rst:177
+#: ../../c-api/buffer.rst:183
msgid "The shape array is read-only for the consumer."
msgstr ""
-#: ../../c-api/buffer.rst:181
+#: ../../c-api/buffer.rst:187
msgid ""
"An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` "
"giving the number of bytes to skip to get to a new element in each dimension."
msgstr ""
-#: ../../c-api/buffer.rst:185
+#: ../../c-api/buffer.rst:191
msgid ""
"Stride values can be any integer. For regular arrays, strides are usually "
"positive, but a consumer MUST be able to handle the case ``strides[n] <= "
"0``. See `complex arrays`_ for further information."
msgstr ""
-#: ../../c-api/buffer.rst:189
+#: ../../c-api/buffer.rst:195
msgid "The strides array is read-only for the consumer."
msgstr ""
-#: ../../c-api/buffer.rst:193
+#: ../../c-api/buffer.rst:199
msgid ""
"An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`. If "
"``suboffsets[n] >= 0``, the values stored along the nth dimension are "
@@ -276,24 +284,24 @@ msgid ""
"that no de-referencing should occur (striding in a contiguous memory block)."
msgstr ""
-#: ../../c-api/buffer.rst:200
+#: ../../c-api/buffer.rst:206
msgid ""
"If all suboffsets are negative (i.e. no de-referencing is needed), then this "
"field must be ``NULL`` (the default value)."
msgstr ""
-#: ../../c-api/buffer.rst:203
+#: ../../c-api/buffer.rst:209
msgid ""
"This type of array representation is used by the Python Imaging Library "
"(PIL). See `complex arrays`_ for further information how to access elements "
"of such an array."
msgstr ""
-#: ../../c-api/buffer.rst:207
+#: ../../c-api/buffer.rst:213
msgid "The suboffsets array is read-only for the consumer."
msgstr ""
-#: ../../c-api/buffer.rst:211
+#: ../../c-api/buffer.rst:217
msgid ""
"This is for use internally by the exporting object. For example, this might "
"be re-cast as an integer by the exporter and used to store flags about "
@@ -301,22 +309,22 @@ msgid ""
"the buffer is released. The consumer MUST NOT alter this value."
msgstr ""
-#: ../../c-api/buffer.rst:218
+#: ../../c-api/buffer.rst:224
msgid "Constants:"
msgstr "常數:"
-#: ../../c-api/buffer.rst:222
+#: ../../c-api/buffer.rst:228
msgid ""
"The maximum number of dimensions the memory represents. Exporters MUST "
"respect this limit, consumers of multi-dimensional buffers SHOULD be able to "
"handle up to :c:macro:`!PyBUF_MAX_NDIM` dimensions. Currently set to 64."
msgstr ""
-#: ../../c-api/buffer.rst:231
+#: ../../c-api/buffer.rst:237
msgid "Buffer request types"
msgstr ""
-#: ../../c-api/buffer.rst:233
+#: ../../c-api/buffer.rst:239
msgid ""
"Buffers are usually obtained by sending a buffer request to an exporting "
"object via :c:func:`PyObject_GetBuffer`. Since the complexity of the logical "
@@ -324,16 +332,16 @@ msgid ""
"argument to specify the exact buffer type it can handle."
msgstr ""
-#: ../../c-api/buffer.rst:238
+#: ../../c-api/buffer.rst:244
msgid ""
"All :c:type:`Py_buffer` fields are unambiguously defined by the request type."
msgstr ""
-#: ../../c-api/buffer.rst:242
+#: ../../c-api/buffer.rst:248
msgid "request-independent fields"
msgstr ""
-#: ../../c-api/buffer.rst:243
+#: ../../c-api/buffer.rst:249
msgid ""
"The following fields are not influenced by *flags* and must always be filled "
"in with the correct values: :c:member:`~Py_buffer.obj`, :c:member:"
@@ -341,11 +349,11 @@ msgid ""
"itemsize`, :c:member:`~Py_buffer.ndim`."
msgstr ""
-#: ../../c-api/buffer.rst:248
+#: ../../c-api/buffer.rst:254
msgid "readonly, format"
msgstr ""
-#: ../../c-api/buffer.rst:252
+#: ../../c-api/buffer.rst:258
msgid ""
"Controls the :c:member:`~Py_buffer.readonly` field. If set, the exporter "
"MUST provide a writable buffer or else report failure. Otherwise, the "
@@ -354,13 +362,13 @@ msgid ""
"PyBUF_WRITABLE` can be used to request a simple writable buffer."
msgstr ""
-#: ../../c-api/buffer.rst:260
+#: ../../c-api/buffer.rst:266
msgid ""
"Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be "
"filled in correctly. Otherwise, this field MUST be ``NULL``."
msgstr ""
-#: ../../c-api/buffer.rst:264
+#: ../../c-api/buffer.rst:270
msgid ""
":c:macro:`PyBUF_WRITABLE` can be \\|'d to any of the flags in the next "
"section. Since :c:macro:`PyBUF_SIMPLE` is defined as 0, :c:macro:"
@@ -368,159 +376,159 @@ msgid ""
"writable buffer."
msgstr ""
-#: ../../c-api/buffer.rst:268
+#: ../../c-api/buffer.rst:274
msgid ""
":c:macro:`PyBUF_FORMAT` must be \\|'d to any of the flags except :c:macro:"
"`PyBUF_SIMPLE`, because the latter already implies format ``B`` (unsigned "
"bytes). :c:macro:`!PyBUF_FORMAT` cannot be used on its own."
msgstr ""
-#: ../../c-api/buffer.rst:274
+#: ../../c-api/buffer.rst:280
msgid "shape, strides, suboffsets"
msgstr ""
-#: ../../c-api/buffer.rst:276
+#: ../../c-api/buffer.rst:282
msgid ""
"The flags that control the logical structure of the memory are listed in "
"decreasing order of complexity. Note that each flag contains all bits of the "
"flags below it."
msgstr ""
-#: ../../c-api/buffer.rst:283 ../../c-api/buffer.rst:307
-#: ../../c-api/buffer.rst:332
+#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313
+#: ../../c-api/buffer.rst:338
msgid "Request"
msgstr ""
-#: ../../c-api/buffer.rst:283 ../../c-api/buffer.rst:307
-#: ../../c-api/buffer.rst:332
+#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313
+#: ../../c-api/buffer.rst:338
msgid "shape"
msgstr ""
-#: ../../c-api/buffer.rst:283 ../../c-api/buffer.rst:307
-#: ../../c-api/buffer.rst:332
+#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313
+#: ../../c-api/buffer.rst:338
msgid "strides"
msgstr ""
-#: ../../c-api/buffer.rst:283 ../../c-api/buffer.rst:307
-#: ../../c-api/buffer.rst:332
+#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313
+#: ../../c-api/buffer.rst:338
msgid "suboffsets"
msgstr ""
-#: ../../c-api/buffer.rst:285 ../../c-api/buffer.rst:287
-#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:309
-#: ../../c-api/buffer.rst:311 ../../c-api/buffer.rst:313
-#: ../../c-api/buffer.rst:315 ../../c-api/buffer.rst:334
-#: ../../c-api/buffer.rst:336 ../../c-api/buffer.rst:338
-#: ../../c-api/buffer.rst:340 ../../c-api/buffer.rst:342
-#: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:346
-#: ../../c-api/buffer.rst:348
+#: ../../c-api/buffer.rst:291 ../../c-api/buffer.rst:293
+#: ../../c-api/buffer.rst:295 ../../c-api/buffer.rst:315
+#: ../../c-api/buffer.rst:317 ../../c-api/buffer.rst:319
+#: ../../c-api/buffer.rst:321 ../../c-api/buffer.rst:340
+#: ../../c-api/buffer.rst:342 ../../c-api/buffer.rst:344
+#: ../../c-api/buffer.rst:346 ../../c-api/buffer.rst:348
+#: ../../c-api/buffer.rst:350 ../../c-api/buffer.rst:352
+#: ../../c-api/buffer.rst:354
msgid "yes"
msgstr ""
-#: ../../c-api/buffer.rst:285 ../../c-api/buffer.rst:334
-#: ../../c-api/buffer.rst:336
+#: ../../c-api/buffer.rst:291 ../../c-api/buffer.rst:340
+#: ../../c-api/buffer.rst:342
msgid "if needed"
msgstr ""
-#: ../../c-api/buffer.rst:287 ../../c-api/buffer.rst:289
-#: ../../c-api/buffer.rst:291 ../../c-api/buffer.rst:309
-#: ../../c-api/buffer.rst:311 ../../c-api/buffer.rst:313
-#: ../../c-api/buffer.rst:315 ../../c-api/buffer.rst:338
-#: ../../c-api/buffer.rst:340 ../../c-api/buffer.rst:342
-#: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:346
-#: ../../c-api/buffer.rst:348
+#: ../../c-api/buffer.rst:293 ../../c-api/buffer.rst:295
+#: ../../c-api/buffer.rst:297 ../../c-api/buffer.rst:315
+#: ../../c-api/buffer.rst:317 ../../c-api/buffer.rst:319
+#: ../../c-api/buffer.rst:321 ../../c-api/buffer.rst:344
+#: ../../c-api/buffer.rst:346 ../../c-api/buffer.rst:348
+#: ../../c-api/buffer.rst:350 ../../c-api/buffer.rst:352
+#: ../../c-api/buffer.rst:354
msgid "NULL"
msgstr "NULL"
-#: ../../c-api/buffer.rst:298
+#: ../../c-api/buffer.rst:304
msgid "contiguity requests"
msgstr ""
-#: ../../c-api/buffer.rst:300
+#: ../../c-api/buffer.rst:306
msgid ""
"C or Fortran :term:`contiguity ` can be explicitly requested, "
"with and without stride information. Without stride information, the buffer "
"must be C-contiguous."
msgstr ""
-#: ../../c-api/buffer.rst:307 ../../c-api/buffer.rst:332
+#: ../../c-api/buffer.rst:313 ../../c-api/buffer.rst:338
msgid "contig"
msgstr ""
-#: ../../c-api/buffer.rst:309 ../../c-api/buffer.rst:315
-#: ../../c-api/buffer.rst:346 ../../c-api/buffer.rst:348
+#: ../../c-api/buffer.rst:315 ../../c-api/buffer.rst:321
+#: ../../c-api/buffer.rst:352 ../../c-api/buffer.rst:354
msgid "C"
msgstr "C"
-#: ../../c-api/buffer.rst:311
+#: ../../c-api/buffer.rst:317
msgid "F"
msgstr "F"
-#: ../../c-api/buffer.rst:313
+#: ../../c-api/buffer.rst:319
msgid "C or F"
msgstr "C 或 F"
-#: ../../c-api/buffer.rst:315
+#: ../../c-api/buffer.rst:321
msgid ":c:macro:`PyBUF_ND`"
msgstr ":c:macro:`PyBUF_ND`"
-#: ../../c-api/buffer.rst:320
+#: ../../c-api/buffer.rst:326
msgid "compound requests"
msgstr ""
-#: ../../c-api/buffer.rst:322
+#: ../../c-api/buffer.rst:328
msgid ""
"All possible requests are fully defined by some combination of the flags in "
"the previous section. For convenience, the buffer protocol provides "
"frequently used combinations as single flags."
msgstr ""
-#: ../../c-api/buffer.rst:326
+#: ../../c-api/buffer.rst:332
msgid ""
"In the following table *U* stands for undefined contiguity. The consumer "
"would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity."
msgstr ""
-#: ../../c-api/buffer.rst:332
+#: ../../c-api/buffer.rst:338
msgid "readonly"
msgstr ""
-#: ../../c-api/buffer.rst:332
+#: ../../c-api/buffer.rst:338
msgid "format"
msgstr ""
-#: ../../c-api/buffer.rst:334 ../../c-api/buffer.rst:336
-#: ../../c-api/buffer.rst:338 ../../c-api/buffer.rst:340
-#: ../../c-api/buffer.rst:342 ../../c-api/buffer.rst:344
+#: ../../c-api/buffer.rst:340 ../../c-api/buffer.rst:342
+#: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:346
+#: ../../c-api/buffer.rst:348 ../../c-api/buffer.rst:350
msgid "U"
msgstr "U"
-#: ../../c-api/buffer.rst:334 ../../c-api/buffer.rst:338
-#: ../../c-api/buffer.rst:342 ../../c-api/buffer.rst:346
+#: ../../c-api/buffer.rst:340 ../../c-api/buffer.rst:344
+#: ../../c-api/buffer.rst:348 ../../c-api/buffer.rst:352
msgid "0"
msgstr "0"
-#: ../../c-api/buffer.rst:336 ../../c-api/buffer.rst:340
-#: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:348
+#: ../../c-api/buffer.rst:342 ../../c-api/buffer.rst:346
+#: ../../c-api/buffer.rst:350 ../../c-api/buffer.rst:354
msgid "1 or 0"
msgstr "1 或 0"
-#: ../../c-api/buffer.rst:353
+#: ../../c-api/buffer.rst:359
msgid "Complex arrays"
msgstr ""
-#: ../../c-api/buffer.rst:356
+#: ../../c-api/buffer.rst:362
msgid "NumPy-style: shape and strides"
msgstr ""
-#: ../../c-api/buffer.rst:358
+#: ../../c-api/buffer.rst:364
msgid ""
"The logical structure of NumPy-style arrays is defined by :c:member:"
"`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer."
"shape` and :c:member:`~Py_buffer.strides`."
msgstr ""
-#: ../../c-api/buffer.rst:361
+#: ../../c-api/buffer.rst:367
msgid ""
"If ``ndim == 0``, the memory location pointed to by :c:member:`~Py_buffer."
"buf` is interpreted as a scalar of size :c:member:`~Py_buffer.itemsize`. In "
@@ -528,14 +536,14 @@ msgid ""
"strides` are ``NULL``."
msgstr ""
-#: ../../c-api/buffer.rst:365
+#: ../../c-api/buffer.rst:371
msgid ""
"If :c:member:`~Py_buffer.strides` is ``NULL``, the array is interpreted as a "
"standard n-dimensional C-array. Otherwise, the consumer must access an n-"
"dimensional array as follows:"
msgstr ""
-#: ../../c-api/buffer.rst:369
+#: ../../c-api/buffer.rst:375
msgid ""
"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * "
"strides[n-1];\n"
@@ -545,14 +553,14 @@ msgstr ""
"strides[n-1];\n"
"item = *((typeof(item) *)ptr);"
-#: ../../c-api/buffer.rst:375
+#: ../../c-api/buffer.rst:381
msgid ""
"As noted above, :c:member:`~Py_buffer.buf` can point to any location within "
"the actual memory block. An exporter can check the validity of a buffer with "
"this function:"
msgstr ""
-#: ../../c-api/buffer.rst:379
+#: ../../c-api/buffer.rst:385
msgid ""
"def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n"
" \"\"\"Verify that the parameters represent a valid array within\n"
@@ -581,11 +589,11 @@ msgid ""
" return 0 <= offset+imin and offset+imax+itemsize <= memlen"
msgstr ""
-#: ../../c-api/buffer.rst:409
+#: ../../c-api/buffer.rst:415
msgid "PIL-style: shape, strides and suboffsets"
msgstr ""
-#: ../../c-api/buffer.rst:411
+#: ../../c-api/buffer.rst:417
msgid ""
"In addition to the regular items, PIL-style arrays can contain pointers that "
"must be followed in order to get to the next element in a dimension. For "
@@ -596,14 +604,14 @@ msgid ""
"x[2][3]`` arrays that can be located anywhere in memory."
msgstr ""
-#: ../../c-api/buffer.rst:420
+#: ../../c-api/buffer.rst:426
msgid ""
"Here is a function that returns a pointer to the element in an N-D array "
"pointed to by an N-dimensional index when there are both non-``NULL`` "
"strides and suboffsets::"
msgstr ""
-#: ../../c-api/buffer.rst:424
+#: ../../c-api/buffer.rst:430
msgid ""
"void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n"
" Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n"
@@ -631,25 +639,25 @@ msgstr ""
" return (void*)pointer;\n"
"}"
-#: ../../c-api/buffer.rst:439
+#: ../../c-api/buffer.rst:445
msgid "Buffer-related functions"
msgstr ""
-#: ../../c-api/buffer.rst:443
+#: ../../c-api/buffer.rst:449
msgid ""
"Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When "
"``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` "
"will succeed. This function always succeeds."
msgstr ""
-#: ../../c-api/buffer.rst:450
+#: ../../c-api/buffer.rst:456
msgid ""
"Send a request to *exporter* to fill in *view* as specified by *flags*. If "
"the exporter cannot provide a buffer of the exact type, it MUST raise :exc:"
"`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``."
msgstr ""
-#: ../../c-api/buffer.rst:455
+#: ../../c-api/buffer.rst:461
msgid ""
"On success, fill in *view*, set ``view->obj`` to a new reference to "
"*exporter* and return 0. In the case of chained buffer providers that "
@@ -657,7 +665,7 @@ msgid ""
"instead of *exporter* (See :ref:`Buffer Object Structures `)."
msgstr ""
-#: ../../c-api/buffer.rst:460
+#: ../../c-api/buffer.rst:466
msgid ""
"Successful calls to :c:func:`PyObject_GetBuffer` must be paired with calls "
"to :c:func:`PyBuffer_Release`, similar to :c:func:`malloc` and :c:func:"
@@ -665,7 +673,7 @@ msgid ""
"`PyBuffer_Release` must be called exactly once."
msgstr ""
-#: ../../c-api/buffer.rst:468
+#: ../../c-api/buffer.rst:474
msgid ""
"Release the buffer *view* and release the :term:`strong reference` (i.e. "
"decrement the reference count) to the view's supporting object, ``view-"
@@ -673,19 +681,19 @@ msgid ""
"used, otherwise reference leaks may occur."
msgstr ""
-#: ../../c-api/buffer.rst:473
+#: ../../c-api/buffer.rst:479
msgid ""
"It is an error to call this function on a buffer that was not obtained via :"
"c:func:`PyObject_GetBuffer`."
msgstr ""
-#: ../../c-api/buffer.rst:479
+#: ../../c-api/buffer.rst:485
msgid ""
"Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:"
"`~Py_buffer.format`. On error, raise an exception and return -1."
msgstr ""
-#: ../../c-api/buffer.rst:487
+#: ../../c-api/buffer.rst:493
msgid ""
"Return ``1`` if the memory defined by the *view* is C-style (*order* is "
"``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either "
@@ -693,69 +701,69 @@ msgid ""
"succeeds."
msgstr ""
-#: ../../c-api/buffer.rst:494
+#: ../../c-api/buffer.rst:500
msgid ""
"Get the memory area pointed to by the *indices* inside the given *view*. "
"*indices* must point to an array of ``view->ndim`` indices."
msgstr ""
-#: ../../c-api/buffer.rst:500
+#: ../../c-api/buffer.rst:506
msgid ""
"Copy contiguous *len* bytes from *buf* to *view*. *fort* can be ``'C'`` or "
"``'F'`` (for C-style or Fortran-style ordering). ``0`` is returned on "
"success, ``-1`` on error."
msgstr ""
-#: ../../c-api/buffer.rst:507
+#: ../../c-api/buffer.rst:513
msgid ""
"Copy *len* bytes from *src* to its contiguous representation in *buf*. "
"*order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style "
"ordering or either one). ``0`` is returned on success, ``-1`` on error."
msgstr ""
-#: ../../c-api/buffer.rst:511
+#: ../../c-api/buffer.rst:517
msgid "This function fails if *len* != *src->len*."
msgstr ""
-#: ../../c-api/buffer.rst:516
+#: ../../c-api/buffer.rst:522
msgid ""
"Copy data from *src* to *dest* buffer. Can convert between C-style and or "
"Fortran-style buffers."
msgstr ""
-#: ../../c-api/buffer.rst:519
+#: ../../c-api/buffer.rst:525
msgid "``0`` is returned on success, ``-1`` on error."
msgstr ""
-#: ../../c-api/buffer.rst:523
+#: ../../c-api/buffer.rst:529
msgid ""
"Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style "
"if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the "
"given shape with the given number of bytes per element."
msgstr ""
-#: ../../c-api/buffer.rst:530
+#: ../../c-api/buffer.rst:536
msgid ""
"Handle buffer requests for an exporter that wants to expose *buf* of size "
"*len* with writability set according to *readonly*. *buf* is interpreted as "
"a sequence of unsigned bytes."
msgstr ""
-#: ../../c-api/buffer.rst:534
+#: ../../c-api/buffer.rst:540
msgid ""
"The *flags* argument indicates the request type. This function always fills "
"in *view* as specified by flags, unless *buf* has been designated as read-"
"only and :c:macro:`PyBUF_WRITABLE` is set in *flags*."
msgstr ""
-#: ../../c-api/buffer.rst:538
+#: ../../c-api/buffer.rst:544
msgid ""
"On success, set ``view->obj`` to a new reference to *exporter* and return 0. "
"Otherwise, raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and "
"return ``-1``;"
msgstr ""
-#: ../../c-api/buffer.rst:542
+#: ../../c-api/buffer.rst:548
msgid ""
"If this function is used as part of a :ref:`getbufferproc `, "
"*exporter* MUST be set to the exporting object and *flags* must be passed "
@@ -782,14 +790,14 @@ msgstr "buffer object(緩衝物件)"
msgid "PyBufferProcs (C type)"
msgstr "PyBufferProcs(C 型別)"
-#: ../../c-api/buffer.rst:295
+#: ../../c-api/buffer.rst:301
msgid "contiguous"
msgstr "contiguous(連續的)"
-#: ../../c-api/buffer.rst:295
+#: ../../c-api/buffer.rst:301
msgid "C-contiguous"
msgstr "C-contiguous(C 連續的)"
-#: ../../c-api/buffer.rst:295
+#: ../../c-api/buffer.rst:301
msgid "Fortran contiguous"
msgstr "Fortran contiguous(Fortran 連續的)"
diff --git a/c-api/cell.po b/c-api/cell.po
index 26beccfb9a..1b56cd0661 100644
--- a/c-api/cell.po
+++ b/c-api/cell.po
@@ -89,7 +89,7 @@ msgid ""
"reference to any current content of the cell. *value* may be ``NULL``. "
"*cell* must be non-``NULL``."
msgstr ""
-"將 cell 物件 *cell* 的內容設為 *value*。這將釋放任何對 cell 物件當前內容的參"
+"將 cell 物件 *cell* 的內容設為 *value*。這將釋放任何對 cell 物件目前內容的參"
"照。*value* 可以為 ``NULL``。*cell* 必須不為 ``NULL``。"
#: ../../c-api/cell.rst:58
diff --git a/c-api/codec.po b/c-api/codec.po
index 3cd05b00bc..6fd7c61a7f 100644
--- a/c-api/codec.po
+++ b/c-api/codec.po
@@ -24,7 +24,7 @@ msgstr "編解碼器註冊表和支援函式"
#: ../../c-api/codec.rst:8
msgid "Register a new codec search function."
-msgstr "註冊一個新的編解碼器搜索函式。"
+msgstr "註冊一個新的編解碼器搜尋函式。"
#: ../../c-api/codec.rst:10
msgid ""
@@ -32,7 +32,7 @@ msgid ""
"done, to make sure that it is always first in the list of search functions."
msgstr ""
"作為副作用 (side effect),這會嘗試載入 :mod:`!encodings`\\ (如果尚未完成),"
-"以確保它始終位於搜索函式列表中的第一個。"
+"以確保它始終位於搜尋函式列表中的第一個。"
#: ../../c-api/codec.rst:15
msgid ""
@@ -40,7 +40,7 @@ msgid ""
"search function is not registered, do nothing. Return 0 on success. Raise an "
"exception and return -1 on error."
msgstr ""
-"取消註冊編解碼器搜索函式並清除註冊表 (registry) 的快取。如果搜索函式並未被註"
+"取消註冊編解碼器搜尋函式並清除註冊表 (registry) 的快取。如果搜尋函式並未被註"
"冊,則不執行任何操作。成功回傳 0,發生錯誤時會引發例外並回傳 -1。"
#: ../../c-api/codec.rst:23
diff --git a/c-api/complex.po b/c-api/complex.po
index a6448fac77..a22103f9b4 100644
--- a/c-api/complex.po
+++ b/c-api/complex.po
@@ -81,14 +81,14 @@ msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數之和
#: ../../c-api/complex.rst:49
msgid ""
-"Return the difference between two complex numbers, using the C :c:type:"
-"`Py_complex` representation."
+"Return the difference between two complex numbers, using the "
+"C :c:type:`Py_complex` representation."
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數間的差。"
#: ../../c-api/complex.rst:55
msgid ""
-"Return the negation of the complex number *num*, using the C :c:type:"
-"`Py_complex` representation."
+"Return the negation of the complex number *num*, using the "
+"C :c:type:`Py_complex` representation."
msgstr ""
"以 C 的 :c:type:`Py_complex` 表示形式來回傳複數 *num* 的相反數 (negation)。"
@@ -106,16 +106,16 @@ msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數的商
#: ../../c-api/complex.rst:70
msgid ""
-"If *divisor* is null, this method returns zero and sets :c:data:`errno` to :"
-"c:macro:`!EDOM`."
+"If *divisor* is null, this method returns zero and sets :c:data:`errno` "
+"to :c:macro:`!EDOM`."
msgstr ""
-"如果 *divisor* 為 null,則此方法會回傳零並將 :c:data:`errno` 設定為 :c:macro:"
-"`!EDOM`。"
+"如果 *divisor* 為 null,則此方法會回傳零並將 :c:data:`errno` 設定"
+"為 :c:macro:`!EDOM`。"
#: ../../c-api/complex.rst:76
msgid ""
-"Return the exponentiation of *num* by *exp*, using the C :c:type:"
-"`Py_complex` representation."
+"Return the exponentiation of *num* by *exp*, using the "
+"C :c:type:`Py_complex` representation."
msgstr ""
"以 C 的 :c:type:`Py_complex` 表示形式來回傳 *num* 的 *exp* 次方的結果。"
@@ -141,13 +141,13 @@ msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python complex number "
"type. It is the same object as :class:`complex` in the Python layer."
msgstr ""
-"這個 :c:type:`PyTypeObject` 的實例代表 Python 複數型別。它與 Python 層中的 :"
-"class:`complex` 是同一個物件。"
+"這個 :c:type:`PyTypeObject` 的實例代表 Python 複數型別。它與 Python 層中"
+"的 :class:`complex` 是同一個物件。"
#: ../../c-api/complex.rst:100
msgid ""
-"Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :"
-"c:type:`PyComplexObject`. This function always succeeds."
+"Return true if its argument is a :c:type:`PyComplexObject` or a subtype "
+"of :c:type:`PyComplexObject`. This function always succeeds."
msgstr ""
"如果其引數是一個 :c:type:`PyComplexObject` 或者是 :c:type:`PyComplexObject` "
"的子型別,則會回傳 true。這個函式不會失敗。"
@@ -181,25 +181,24 @@ msgid "Return the real part of *op* as a C :c:expr:`double`."
msgstr "以 C 的 :c:expr:`double` 形式回傳 *op* 的實部。"
#: ../../c-api/complex.rst:126
-#, fuzzy
msgid ""
-"If *op* is not a Python complex number object but has a :meth:`~object."
-"__complex__` method, this method will first be called to convert *op* to a "
-"Python complex number object. If :meth:`!__complex__` is not defined then "
-"it falls back to call :c:func:`PyFloat_AsDouble` and returns its result."
+"If *op* is not a Python complex number object but has "
+"a :meth:`~object.__complex__` method, this method will first be called to "
+"convert *op* to a Python complex number object. If :meth:`!__complex__` is "
+"not defined then it falls back to call :c:func:`PyFloat_AsDouble` and "
+"returns its result."
msgstr ""
"如果 *op* 不是 Python 複數物件,但有一個 :meth:`~object.__complex__` 方法,則"
"首先會呼叫該方法將 *op* 轉換為 Python 複數物件。如果 :meth:`!__complex__` 並"
-"未定義,那麼它會回退到 :meth:`~object.__float__`。如果 :meth:`!__float__` 未"
-"定義,則它將繼續回退為 :meth:`~object.__index__`。"
+"未定義,那麼它會回退到呼叫 :func:`PyFloat_AsDouble` 並回傳其結果。"
#: ../../c-api/complex.rst:132 ../../c-api/complex.rst:148
msgid ""
"Upon failure, this method returns ``-1.0`` with an exception set, so one "
"should call :c:func:`PyErr_Occurred` to check for errors."
msgstr ""
-"失敗時,此方法回傳 ``-1.0`` 並設定例外,因此應該呼叫 :c:func:"
-"`PyErr_Occurred` 來檢查錯誤。"
+"失敗時,此方法回傳 ``-1.0`` 並設定例外,因此應該呼"
+"叫 :c:func:`PyErr_Occurred` 來檢查錯誤。"
#: ../../c-api/complex.rst:135 ../../c-api/complex.rst:151
msgid "Use :meth:`~object.__complex__` if available."
@@ -210,18 +209,16 @@ msgid "Return the imaginary part of *op* as a C :c:expr:`double`."
msgstr "將 *op* 的虛部作為 C 的 :c:expr:`double` 回傳。"
#: ../../c-api/complex.rst:142
-#, fuzzy
msgid ""
-"If *op* is not a Python complex number object but has a :meth:`~object."
-"__complex__` method, this method will first be called to convert *op* to a "
-"Python complex number object. If :meth:`!__complex__` is not defined then "
-"it falls back to call :c:func:`PyFloat_AsDouble` and returns ``0.0`` on "
-"success."
+"If *op* is not a Python complex number object but has "
+"a :meth:`~object.__complex__` method, this method will first be called to "
+"convert *op* to a Python complex number object. If :meth:`!__complex__` is "
+"not defined then it falls back to call :c:func:`PyFloat_AsDouble` and "
+"returns ``0.0`` on success."
msgstr ""
"如果 *op* 不是 Python 複數物件,但有一個 :meth:`~object.__complex__` 方法,則"
"首先會呼叫該方法將 *op* 轉換為 Python 複數物件。如果 :meth:`!__complex__` 並"
-"未定義,那麼它會回退到 :meth:`~object.__float__`。如果 :meth:`!__float__` 未"
-"定義,則它將繼續回退為 :meth:`~object.__index__`。"
+"未定義,那麼它會回退到呼叫 :func:`PyFloat_AsDouble` 並於成功時回傳 ``0.0``。"
#: ../../c-api/complex.rst:156
msgid "Return the :c:type:`Py_complex` value of the complex number *op*."
@@ -229,11 +226,11 @@ msgstr "回傳複數 *op* 的 :c:type:`Py_complex` 值。"
#: ../../c-api/complex.rst:158
msgid ""
-"If *op* is not a Python complex number object but has a :meth:`~object."
-"__complex__` method, this method will first be called to convert *op* to a "
-"Python complex number object. If :meth:`!__complex__` is not defined then "
-"it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not "
-"defined then it falls back to :meth:`~object.__index__`."
+"If *op* is not a Python complex number object but has "
+"a :meth:`~object.__complex__` method, this method will first be called to "
+"convert *op* to a Python complex number object. If :meth:`!__complex__` is "
+"not defined then it falls back to :meth:`~object.__float__`. If :meth:`!"
+"__float__` is not defined then it falls back to :meth:`~object.__index__`."
msgstr ""
"如果 *op* 不是 Python 複數物件,但有一個 :meth:`~object.__complex__` 方法,則"
"首先會呼叫該方法將 *op* 轉換為 Python 複數物件。如果 :meth:`!__complex__` 並"
@@ -242,9 +239,9 @@ msgstr ""
#: ../../c-api/complex.rst:164
msgid ""
-"Upon failure, this method returns :c:type:`Py_complex` with :c:member:"
-"`~Py_complex.real` set to ``-1.0`` and with an exception set, so one should "
-"call :c:func:`PyErr_Occurred` to check for errors."
+"Upon failure, this method returns :c:type:`Py_complex` "
+"with :c:member:`~Py_complex.real` set to ``-1.0`` and with an exception set, "
+"so one should call :c:func:`PyErr_Occurred` to check for errors."
msgstr ""
"失敗時,此方法回傳 :c:type:`Py_complex` 並將 :c:member:`~Py_complex.real` 設"
"為 ``-1.0``,並設定例外,因此應該呼叫 :c:func:`PyErr_Occurred` 來檢查錯誤。"
diff --git a/c-api/datetime.po b/c-api/datetime.po
index aca575f97c..60f4918fdc 100644
--- a/c-api/datetime.po
+++ b/c-api/datetime.po
@@ -38,7 +38,7 @@ msgid ""
msgstr ""
":mod:`datetime` 模組提供各種日期和時間物件。在使用任何這些函式之前,必須將標"
"頭檔 :file:`datetime.h` 引入於原始碼中(請注意,:file:`Python.h` 並無引入該標"
-"頭檔),且巨集 :c:macro:`!PyDateTime_IMPORT` 必須被調用,而這通常作為模組初始"
+"頭檔),且巨集 :c:macro:`!PyDateTime_IMPORT` 必須被叫用,而這通常作為模組初始"
"化函式的一部分。該巨集將指向 C 結構的指標放入靜態變數 :c:data:`!"
"PyDateTimeAPI` 中,該變數會被以下巨集使用。"
diff --git a/c-api/dict.po b/c-api/dict.po
index 5a9c30db1f..b11b75f775 100644
--- a/c-api/dict.po
+++ b/c-api/dict.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-23 07:52+0800\n"
+"POT-Creation-Date: 2025-02-21 00:13+0000\n"
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
"Last-Translator: Liang-Bo Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -34,8 +34,8 @@ msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python dictionary "
"type. This is the same object as :class:`dict` in the Python layer."
msgstr ""
-":c:type:`PyTypeObject` 實例代表一個 Python 字典型態。此與 Python 層中的 :"
-"class:`dict` 為同一個物件。"
+":c:type:`PyTypeObject` 實例代表一個 Python 字典型態。此與 Python 層中"
+"的 :class:`dict` 為同一個物件。"
#: ../../c-api/dict.rst:24
msgid ""
@@ -77,9 +77,9 @@ msgstr ""
#: ../../c-api/dict.rst:60
msgid ""
-"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a :"
-"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
-"`PyObject*`."
+"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as "
+"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
msgstr ""
#: ../../c-api/dict.rst:69
@@ -88,32 +88,32 @@ msgstr ""
#: ../../c-api/dict.rst:74
msgid ""
-"Insert *val* into the dictionary *p* with a key of *key*. *key* must be :"
-"term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return ``0`` "
-"on success or ``-1`` on failure. This function *does not* steal a reference "
-"to *val*."
+"Insert *val* into the dictionary *p* with a key of *key*. *key* must "
+"be :term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return "
+"``0`` on success or ``-1`` on failure. This function *does not* steal a "
+"reference to *val*."
msgstr ""
#: ../../c-api/dict.rst:82
msgid ""
-"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:"
-"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
-"`PyObject*`."
+"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as "
+"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
msgstr ""
#: ../../c-api/dict.rst:89
msgid ""
-"Remove the entry in dictionary *p* with key *key*. *key* must be :term:"
-"`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the "
-"dictionary, :exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on "
-"failure."
+"Remove the entry in dictionary *p* with key *key*. *key* must "
+"be :term:`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is "
+"not in the dictionary, :exc:`KeyError` is raised. Return ``0`` on success or "
+"``-1`` on failure."
msgstr ""
#: ../../c-api/dict.rst:97
msgid ""
-"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a :c:"
-"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
-"`PyObject*`."
+"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as "
+"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
msgstr ""
#: ../../c-api/dict.rst:104
@@ -134,11 +134,11 @@ msgstr ""
#: ../../c-api/dict.rst:110 ../../c-api/dict.rst:207
msgid "On error, raise an exception and return ``-1``."
-msgstr ""
+msgstr "錯誤發生時,引發一個例外並回傳 ``-1``。"
#: ../../c-api/dict.rst:114
msgid "See also the :c:func:`PyObject_GetItem` function."
-msgstr ""
+msgstr "另見 :c:func:`PyObject_GetItem` 函式。"
#: ../../c-api/dict.rst:119
msgid ""
@@ -149,9 +149,9 @@ msgstr ""
#: ../../c-api/dict.rst:125
msgid ""
-"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:"
-"`~object.__eq__` methods are silently ignored. Prefer the :c:func:"
-"`PyDict_GetItemWithError` function instead."
+"Exceptions that occur while this calls :meth:`~object.__hash__` "
+"and :meth:`~object.__eq__` methods are silently ignored. Prefer "
+"the :c:func:`PyDict_GetItemWithError` function instead."
msgstr ""
#: ../../c-api/dict.rst:129
@@ -169,24 +169,25 @@ msgstr ""
#: ../../c-api/dict.rst:144
msgid ""
-"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:"
-"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
-"`PyObject*`."
+"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as "
+"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
msgstr ""
#: ../../c-api/dict.rst:150
msgid ""
-"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:"
-"`~object.__eq__` methods or while creating the temporary :class:`str` object "
-"are silently ignored. Prefer using the :c:func:`PyDict_GetItemWithError` "
-"function with your own :c:func:`PyUnicode_FromString` *key* instead."
+"Exceptions that occur while this calls :meth:`~object.__hash__` "
+"and :meth:`~object.__eq__` methods or while creating the "
+"temporary :class:`str` object are silently ignored. Prefer using "
+"the :c:func:`PyDict_GetItemWithError` function with your "
+"own :c:func:`PyUnicode_FromString` *key* instead."
msgstr ""
#: ../../c-api/dict.rst:159
msgid ""
-"Similar than :c:func:`PyDict_GetItemRef`, but *key* is specified as a :c:"
-"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
-"`PyObject*`."
+"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as "
+"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
msgstr ""
#: ../../c-api/dict.rst:168
@@ -239,7 +240,7 @@ msgstr ""
#: ../../c-api/dict.rst:209
msgid ""
-"This is similar to :meth:`dict.pop`, but without the default value and not "
+"Similar to :meth:`dict.pop`, but without the default value and not "
"raising :exc:`KeyError` if the key missing."
msgstr ""
@@ -252,37 +253,37 @@ msgstr ""
#: ../../c-api/dict.rst:226
msgid ""
"Return a :c:type:`PyListObject` containing all the items from the dictionary."
-msgstr ""
+msgstr "回傳一個包含字典中所有項目的 :c:type:`PyListObject`。"
#: ../../c-api/dict.rst:231
msgid ""
"Return a :c:type:`PyListObject` containing all the keys from the dictionary."
-msgstr ""
+msgstr "回傳一個包含字典中所有鍵的 :c:type:`PyListObject`。"
#: ../../c-api/dict.rst:236
msgid ""
"Return a :c:type:`PyListObject` containing all the values from the "
"dictionary *p*."
-msgstr ""
+msgstr "回傳一個包含字典 *p* 中所有值的 :c:type:`PyListObject`。"
#: ../../c-api/dict.rst:244
msgid ""
"Return the number of items in the dictionary. This is equivalent to "
"``len(p)`` on a dictionary."
-msgstr ""
+msgstr "回傳字典中項目的數量。此與於字典呼叫 ``len(p)`` 等效。"
#: ../../c-api/dict.rst:250
msgid ""
-"Iterate over all key-value pairs in the dictionary *p*. The :c:type:"
-"`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the "
-"first call to this function to start the iteration; the function returns "
-"true for each pair in the dictionary, and false once all pairs have been "
-"reported. The parameters *pkey* and *pvalue* should either point to :c:expr:"
-"`PyObject*` variables that will be filled in with each key and value, "
-"respectively, or may be ``NULL``. Any references returned through them are "
-"borrowed. *ppos* should not be altered during iteration. Its value "
-"represents offsets within the internal dictionary structure, and since the "
-"structure is sparse, the offsets are not consecutive."
+"Iterate over all key-value pairs in the dictionary *p*. "
+"The :c:type:`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` "
+"prior to the first call to this function to start the iteration; the "
+"function returns true for each pair in the dictionary, and false once all "
+"pairs have been reported. The parameters *pkey* and *pvalue* should either "
+"point to :c:expr:`PyObject*` variables that will be filled in with each key "
+"and value, respectively, or may be ``NULL``. Any references returned "
+"through them are borrowed. *ppos* should not be altered during iteration. "
+"Its value represents offsets within the internal dictionary structure, and "
+"since the structure is sparse, the offsets are not consecutive."
msgstr ""
#: ../../c-api/dict.rst:261
@@ -348,8 +349,9 @@ msgstr ""
#: ../../c-api/dict.rst:293
msgid ""
"The function is not thread-safe in the :term:`free-threaded ` build without external synchronization. You can use :c:macro:"
-"`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating over it::"
+"threading>` build without external synchronization. You can "
+"use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while "
+"iterating over it::"
msgstr ""
#: ../../c-api/dict.rst:298
@@ -360,6 +362,11 @@ msgid ""
"}\n"
"Py_END_CRITICAL_SECTION();"
msgstr ""
+"Py_BEGIN_CRITICAL_SECTION(self->dict);\n"
+"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n"
+" ...\n"
+"}\n"
+"Py_END_CRITICAL_SECTION();"
#: ../../c-api/dict.rst:307
msgid ""
@@ -373,10 +380,10 @@ msgstr ""
#: ../../c-api/dict.rst:317
msgid ""
-"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a."
-"update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back "
-"to the iterating over a sequence of key value pairs if the second argument "
-"has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an "
+"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to "
+"``a.update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall "
+"back to the iterating over a sequence of key value pairs if the second "
+"argument has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an "
"exception was raised."
msgstr ""
@@ -411,15 +418,15 @@ msgstr ""
#: ../../c-api/dict.rst:349
msgid ""
-"Clear watcher identified by *watcher_id* previously returned from :c:func:"
-"`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the "
-"given *watcher_id* was never registered.)"
+"Clear watcher identified by *watcher_id* previously returned "
+"from :c:func:`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error "
+"(e.g. if the given *watcher_id* was never registered.)"
msgstr ""
#: ../../c-api/dict.rst:357
msgid ""
-"Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:"
-"func:`PyDict_AddWatcher` will be called when *dict* is modified or "
+"Mark dictionary *dict* as watched. The callback granted *watcher_id* "
+"by :c:func:`PyDict_AddWatcher` will be called when *dict* is modified or "
"deallocated. Return ``0`` on success or ``-1`` on error."
msgstr ""
@@ -485,8 +492,8 @@ msgstr ""
#: ../../c-api/dict.rst:409
msgid ""
"If the callback sets an exception, it must return ``-1``; this exception "
-"will be printed as an unraisable exception using :c:func:"
-"`PyErr_WriteUnraisable`. Otherwise it should return ``0``."
+"will be printed as an unraisable exception "
+"using :c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``."
msgstr ""
#: ../../c-api/dict.rst:413
diff --git a/c-api/file.po b/c-api/file.po
index ccf0d607eb..cb40f45c72 100644
--- a/c-api/file.po
+++ b/c-api/file.po
@@ -38,7 +38,7 @@ msgid ""
msgstr ""
"這些 API 是用於內建檔案物件的 Python 2 C API 的最小模擬 (minimal emulation),"
"它過去依賴於 C 標準函式庫對於緩衝 I/O (:c:expr:`FILE*`) 的支援。在 Python 3 "
-"中,檔案和串流使用新的 :mod:`io` 模組,它在操作系統的低階無緩衝 I/O 上定義了"
+"中,檔案和串流使用新的 :mod:`io` 模組,它在作業系統的低階無緩衝 I/O 上定義了"
"多個層級。下面描述的函式是這些新 API 的便捷 C 包裝器,主要用於直譯器中的內部"
"錯誤報告;建議第三方程式碼改為存取 :mod:`io` API。"
@@ -55,7 +55,7 @@ msgstr ""
"從已打開檔案 *fd* 的檔案描述器建立一個 Python 檔案物件。引數 *name*、"
"*encoding*、*errors* 和 *newline* 可以為 ``NULL`` 以使用預設值; *buffering* "
"可以是 *-1* 以使用預設值。 *name* 被忽略並保留以實作向後相容性。失敗時回傳 "
-"``NULL``。有關引數的更全面描述,請參閱 :func:`io.open` 函式文檔。"
+"``NULL``。有關引數的更全面描述,請參閱 :func:`io.open` 函式文件。"
#: ../../c-api/file.rst:31
msgid ""
@@ -63,7 +63,7 @@ msgid ""
"level file descriptors can produce various issues (such as unexpected "
"ordering of data)."
msgstr ""
-"由於 Python 串流有自己的緩衝層,將它們與操作系統層級檔案描述器混合使用會產生"
+"由於 Python 串流有自己的緩衝層,將它們與作業系統層級檔案描述器混合使用會產生"
"各種問題(例如資料的排序不符合預期)。"
#: ../../c-api/file.rst:35
diff --git a/c-api/function.po b/c-api/function.po
index c9e9a6c79f..299c34cd6c 100644
--- a/c-api/function.po
+++ b/c-api/function.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-12-13 00:03+0000\n"
+"POT-Creation-Date: 2025-02-17 00:15+0000\n"
"PO-Revision-Date: 2022-11-12 15:45+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -37,17 +37,17 @@ msgstr "用於函式的 C 結構。"
#: ../../c-api/function.rst:22
msgid ""
"This is an instance of :c:type:`PyTypeObject` and represents the Python "
-"function type. It is exposed to Python programmers as ``types."
-"FunctionType``."
+"function type. It is exposed to Python programmers as "
+"``types.FunctionType``."
msgstr ""
"這是個 :c:type:`PyTypeObject` 的實例,且代表了 Python 函式型別,Python 程式設"
"計者可透過 ``types.FunctionType`` 使用它。"
#: ../../c-api/function.rst:28
msgid ""
-"Return true if *o* is a function object (has type :c:data:"
-"`PyFunction_Type`). The parameter must not be ``NULL``. This function "
-"always succeeds."
+"Return true if *o* is a function object (has "
+"type :c:data:`PyFunction_Type`). The parameter must not be ``NULL``. This "
+"function always succeeds."
msgstr ""
"如果 *o* 是個函式物件(擁有 :c:data:`PyFunction_Type` 的型別)則回傳 true。參"
"數必須不為 ``NULL``。此函式必能成功執行。"
@@ -63,28 +63,30 @@ msgstr ""
#: ../../c-api/function.rst:37
msgid ""
-"The function's docstring and name are retrieved from the code object. :attr:"
-"`~function.__module__` is retrieved from *globals*. The argument defaults, "
-"annotations and closure are set to ``NULL``. :attr:`~function.__qualname__` "
-"is set to the same value as the code object's :attr:`~codeobject."
-"co_qualname` field."
+"The function's docstring and name are retrieved from the code "
+"object. :attr:`~function.__module__` is retrieved from *globals*. The "
+"argument defaults, annotations and closure are set to "
+"``NULL``. :attr:`~function.__qualname__` is set to the same value as the "
+"code object's :attr:`~codeobject.co_qualname` field."
msgstr ""
-"函式的文件字串 (docstring) 和名稱是從程式碼物件所取得,:attr:`~function."
-"__module__` 是自 *globals* 所取得。引數預設值、標註 (annotation) 和閉包 "
-"(closure) 被設為 ``NULL``,:attr:`~function.__qualname__` 被設為和程式碼物"
+"函式的文件字串 (docstring) 和名稱是從程式碼物件所取"
+"得,:attr:`~function.__module__` 是自 *globals* 所取得。引數預設值、標註 "
+"(annotation) 和閉包 (closure) 被設為 "
+"``NULL``,:attr:`~function.__qualname__` 被設為和程式碼物"
"件 :attr:`~codeobject.co_qualname` 欄位相同的值。"
#: ../../c-api/function.rst:46
msgid ""
-"As :c:func:`PyFunction_New`, but also allows setting the function object's :"
-"attr:`~function.__qualname__` attribute. *qualname* should be a unicode "
-"object or ``NULL``; if ``NULL``, the :attr:`!__qualname__` attribute is set "
-"to the same value as the code object's :attr:`~codeobject.co_qualname` field."
+"As :c:func:`PyFunction_New`, but also allows setting the function "
+"object's :attr:`~function.__qualname__` attribute. *qualname* should be a "
+"unicode object or ``NULL``; if ``NULL``, the :attr:`!__qualname__` attribute "
+"is set to the same value as the code "
+"object's :attr:`~codeobject.co_qualname` field."
msgstr ""
-"和 :c:func:`PyFunction_New` 相似,但也允許函式物件 :attr:`~function."
-"__qualname__` 屬性的設定,*qualname* 應為一個 unicode 物件或是 ``NULL``;如"
-"為 ``NULL``,:attr:`!__qualname__` 屬性會被設為與程式碼物件 :attr:"
-"`~codeobject.co_qualname` 欄位相同的值。"
+"和 :c:func:`PyFunction_New` 相似,但也允許函式物"
+"件 :attr:`~function.__qualname__` 屬性的設定,*qualname* 應為一個 unicode 物"
+"件或是 ``NULL``;如為 ``NULL``,:attr:`!__qualname__` 屬性會被設為與程式碼物"
+"件 :attr:`~codeobject.co_qualname` 欄位相同的值。"
#: ../../c-api/function.rst:57
msgid "Return the code object associated with the function object *op*."
@@ -100,8 +102,9 @@ msgid ""
"attribute of the :ref:`function object ` *op*. It can be "
"*NULL*."
msgstr ""
-"回傳一個\\ :ref:`函式物件 ` *op* 之 :attr:`~function."
-"__module__` 屬性的 :term:`borrowed reference`,它可以是 *NULL*。"
+"回傳一個\\ :ref:`函式物件 ` *op* "
+"之 :attr:`~function.__module__` 屬性的 :term:`borrowed reference`,它可以是 "
+"*NULL*。"
#: ../../c-api/function.rst:71
msgid ""
@@ -180,39 +183,55 @@ msgstr ""
#: ../../c-api/function.rst:138
msgid ""
-"Clear watcher identified by *watcher_id* previously returned from :c:func:"
-"`PyFunction_AddWatcher` for the current interpreter. Return ``0`` on "
-"success, or ``-1`` and set an exception on error (e.g. if the given "
-"*watcher_id* was never registered.)"
+"Clear watcher identified by *watcher_id* previously returned "
+"from :c:func:`PyFunction_AddWatcher` for the current interpreter. Return "
+"``0`` on success, or ``-1`` and set an exception on error (e.g. if the "
+"given *watcher_id* was never registered.)"
msgstr ""
#: ../../c-api/function.rst:148
-msgid ""
-"Enumeration of possible function watcher events: - "
-"``PyFunction_EVENT_CREATE`` - ``PyFunction_EVENT_DESTROY`` - "
-"``PyFunction_EVENT_MODIFY_CODE`` - ``PyFunction_EVENT_MODIFY_DEFAULTS`` - "
-"``PyFunction_EVENT_MODIFY_KWDEFAULTS``"
+msgid "Enumeration of possible function watcher events:"
msgstr ""
-#: ../../c-api/function.rst:160
+#: ../../c-api/function.rst:150
+msgid "``PyFunction_EVENT_CREATE``"
+msgstr "``PyFunction_EVENT_CREATE``"
+
+#: ../../c-api/function.rst:151
+msgid "``PyFunction_EVENT_DESTROY``"
+msgstr "``PyFunction_EVENT_DESTROY``"
+
+#: ../../c-api/function.rst:152
+msgid "``PyFunction_EVENT_MODIFY_CODE``"
+msgstr "``PyFunction_EVENT_MODIFY_CODE``"
+
+#: ../../c-api/function.rst:153
+msgid "``PyFunction_EVENT_MODIFY_DEFAULTS``"
+msgstr "``PyFunction_EVENT_MODIFY_DEFAULTS``"
+
+#: ../../c-api/function.rst:154
+msgid "``PyFunction_EVENT_MODIFY_KWDEFAULTS``"
+msgstr "``PyFunction_EVENT_MODIFY_KWDEFAULTS``"
+
+#: ../../c-api/function.rst:161
msgid "Type of a function watcher callback function."
msgstr ""
-#: ../../c-api/function.rst:162
+#: ../../c-api/function.rst:163
msgid ""
"If *event* is ``PyFunction_EVENT_CREATE`` or ``PyFunction_EVENT_DESTROY`` "
-"then *new_value* will be ``NULL``. Otherwise, *new_value* will hold a :term:"
-"`borrowed reference` to the new value that is about to be stored in *func* "
-"for the attribute that is being modified."
+"then *new_value* will be ``NULL``. Otherwise, *new_value* will hold "
+"a :term:`borrowed reference` to the new value that is about to be stored in "
+"*func* for the attribute that is being modified."
msgstr ""
-#: ../../c-api/function.rst:167
+#: ../../c-api/function.rst:168
msgid ""
"The callback may inspect but must not modify *func*; doing so could have "
"unpredictable effects, including infinite recursion."
msgstr ""
-#: ../../c-api/function.rst:170
+#: ../../c-api/function.rst:171
msgid ""
"If *event* is ``PyFunction_EVENT_CREATE``, then the callback is invoked "
"after `func` has been fully initialized. Otherwise, the callback is invoked "
@@ -224,7 +243,7 @@ msgid ""
"semantics of the Python code being executed."
msgstr ""
-#: ../../c-api/function.rst:179
+#: ../../c-api/function.rst:180
msgid ""
"If *event* is ``PyFunction_EVENT_DESTROY``, Taking a reference in the "
"callback to the about-to-be-destroyed function will resurrect it, preventing "
@@ -232,14 +251,14 @@ msgid ""
"later, any watcher callbacks active at that time will be called again."
msgstr ""
-#: ../../c-api/function.rst:184
+#: ../../c-api/function.rst:185
msgid ""
"If the callback sets an exception, it must return ``-1``; this exception "
-"will be printed as an unraisable exception using :c:func:"
-"`PyErr_WriteUnraisable`. Otherwise it should return ``0``."
+"will be printed as an unraisable exception "
+"using :c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``."
msgstr ""
-#: ../../c-api/function.rst:188
+#: ../../c-api/function.rst:189
msgid ""
"There may already be a pending exception set on entry to the callback. In "
"this case, the callback should return ``0`` with the same exception still "
diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po
index 51c11e9884..5fd35ae6f8 100644
--- a/c-api/gcsupport.po
+++ b/c-api/gcsupport.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-01 22:24+0800\n"
+"POT-Creation-Date: 2025-04-13 00:40+0000\n"
"PO-Revision-Date: 2018-05-23 14:31+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -369,7 +369,7 @@ msgstr ""
msgid ""
"Type of the visitor function to be passed to :c:func:"
"`PyUnstable_GC_VisitObjects`. *arg* is the same as the *arg* passed to "
-"``PyUnstable_GC_VisitObjects``. Return ``0`` to continue iteration, return "
-"``1`` to stop iteration. Other return values are reserved for now so "
+"``PyUnstable_GC_VisitObjects``. Return ``1`` to continue iteration, return "
+"``0`` to stop iteration. Other return values are reserved for now so "
"behavior on returning anything else is undefined."
msgstr ""
diff --git a/c-api/hash.po b/c-api/hash.po
index 42324bd36d..01b52c5549 100644
--- a/c-api/hash.po
+++ b/c-api/hash.po
@@ -22,10 +22,9 @@ msgid "PyHash API"
msgstr "PyHash API"
#: ../../c-api/hash.rst:6
-#, fuzzy
msgid ""
"See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`."
-msgstr "另請參閱 :c:member:`PyTypeObject.tp_hash` 成員。"
+msgstr "另請參閱 :c:member:`PyTypeObject.tp_hash` 成員和 :ref:`numeric-hash`。"
#: ../../c-api/hash.rst:10
msgid "Hash value type: signed integer."
diff --git a/c-api/init.po b/c-api/init.po
index a4bc79d1a8..0ce89e728e 100644
--- a/c-api/init.po
+++ b/c-api/init.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-02-07 00:13+0000\n"
+"POT-Creation-Date: 2025-02-12 00:13+0000\n"
"PO-Revision-Date: 2023-04-24 20:49+0800\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -854,7 +854,7 @@ msgstr ""
#: ../../c-api/init.rst:900
msgid ""
"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get "
-"a :c:expr:`wchar_*` string."
+"a :c:expr:`wchar_t*` string."
msgstr ""
#: ../../c-api/init.rst:604
@@ -2145,7 +2145,7 @@ msgstr ""
#: ../../c-api/init.rst:1790
msgid "A Per-Interpreter GIL"
-msgstr ""
+msgstr "直譯器各別持有的 GIL"
#: ../../c-api/init.rst:1792
msgid ""
diff --git a/c-api/init_config.po b/c-api/init_config.po
index a8fedbc984..3397a5853b 100644
--- a/c-api/init_config.po
+++ b/c-api/init_config.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-12-11 00:14+0000\n"
+"POT-Creation-Date: 2025-03-14 00:14+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -479,7 +479,7 @@ msgstr ""
#: ../../c-api/init_config.rst:952 ../../c-api/init_config.rst:1012
#: ../../c-api/init_config.rst:1064 ../../c-api/init_config.rst:1126
#: ../../c-api/init_config.rst:1180 ../../c-api/init_config.rst:1209
-#: ../../c-api/init_config.rst:1309
+#: ../../c-api/init_config.rst:1298
msgid "Default: ``0``."
msgstr "預設:``0``。"
@@ -573,7 +573,7 @@ msgid ""
"`~PyPreConfig.parse_argv` of *preconfig* is non-zero."
msgstr ""
-#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1370
+#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1359
msgid ""
"The caller is responsible to handle exceptions (error or exit) using :c:func:"
"`PyStatus_Exception` and :c:func:`Py_ExitStatusException`."
@@ -902,7 +902,7 @@ msgid "stdin is always opened in buffered mode."
msgstr ""
#: ../../c-api/init_config.rst:645 ../../c-api/init_config.rst:678
-#: ../../c-api/init_config.rst:1197 ../../c-api/init_config.rst:1341
+#: ../../c-api/init_config.rst:1197 ../../c-api/init_config.rst:1330
msgid "Default: ``1``."
msgstr "預設值:``1``。"
@@ -1215,7 +1215,7 @@ msgid "Install Python signal handlers?"
msgstr ""
#: ../../c-api/init_config.rst:863 ../../c-api/init_config.rst:1047
-#: ../../c-api/init_config.rst:1071 ../../c-api/init_config.rst:1293
+#: ../../c-api/init_config.rst:1071 ../../c-api/init_config.rst:1282
msgid "Default: ``1`` in Python mode, ``0`` in isolated mode."
msgstr ""
@@ -1434,8 +1434,8 @@ msgid ""
"`Py_GetArgcArgv` function."
msgstr ""
-#: ../../c-api/init_config.rst:1029 ../../c-api/init_config.rst:1328
-#: ../../c-api/init_config.rst:1347
+#: ../../c-api/init_config.rst:1029 ../../c-api/init_config.rst:1317
+#: ../../c-api/init_config.rst:1336
msgid "Default: empty list."
msgstr ""
@@ -1740,101 +1740,88 @@ msgid "Set to ``0`` by the :option:`-E` environment variable."
msgstr ""
#: ../../c-api/init_config.rst:1276
-msgid ""
-"If non-zero, ``stdout`` and ``stderr`` will be redirected to the system log."
-msgstr ""
-
-#: ../../c-api/init_config.rst:1279
-msgid "Only available on macOS 10.12 and later, and on iOS."
-msgstr ""
-
-#: ../../c-api/init_config.rst:1281
-msgid "Default: ``0`` (don't use system log)."
-msgstr ""
-
-#: ../../c-api/init_config.rst:1287
msgid "If non-zero, add the user site directory to :data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:1289
+#: ../../c-api/init_config.rst:1278
msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options."
msgstr ""
-#: ../../c-api/init_config.rst:1291
+#: ../../c-api/init_config.rst:1280
msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:1297
+#: ../../c-api/init_config.rst:1286
msgid ""
"Verbose mode. If greater than ``0``, print a message each time a module is "
"imported, showing the place (filename or built-in module) from which it is "
"loaded."
msgstr ""
-#: ../../c-api/init_config.rst:1301
+#: ../../c-api/init_config.rst:1290
msgid ""
"If greater than or equal to ``2``, print a message for each file that is "
"checked for when searching for a module. Also provides information on module "
"cleanup at exit."
msgstr ""
-#: ../../c-api/init_config.rst:1305
+#: ../../c-api/init_config.rst:1294
msgid "Incremented by the :option:`-v` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:1307
+#: ../../c-api/init_config.rst:1296
msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value."
msgstr ""
-#: ../../c-api/init_config.rst:1313
+#: ../../c-api/init_config.rst:1302
msgid ""
"Options of the :mod:`warnings` module to build warnings filters, lowest to "
"highest priority: :data:`sys.warnoptions`."
msgstr ""
-#: ../../c-api/init_config.rst:1316
+#: ../../c-api/init_config.rst:1305
msgid ""
"The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse "
"order: the last :c:member:`PyConfig.warnoptions` item becomes the first item "
"of :data:`warnings.filters` which is checked first (highest priority)."
msgstr ""
-#: ../../c-api/init_config.rst:1321
+#: ../../c-api/init_config.rst:1310
msgid ""
"The :option:`-W` command line options adds its value to :c:member:`~PyConfig."
"warnoptions`, it can be used multiple times."
msgstr ""
-#: ../../c-api/init_config.rst:1324
+#: ../../c-api/init_config.rst:1313
msgid ""
"The :envvar:`PYTHONWARNINGS` environment variable can also be used to add "
"warning options. Multiple options can be specified, separated by commas (``,"
"``)."
msgstr ""
-#: ../../c-api/init_config.rst:1332
+#: ../../c-api/init_config.rst:1321
msgid ""
"If equal to ``0``, Python won't try to write ``.pyc`` files on the import of "
"source modules."
msgstr ""
-#: ../../c-api/init_config.rst:1335
+#: ../../c-api/init_config.rst:1324
msgid ""
"Set to ``0`` by the :option:`-B` command line option and the :envvar:"
"`PYTHONDONTWRITEBYTECODE` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:1338
+#: ../../c-api/init_config.rst:1327
msgid ""
":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:"
"member:`~PyConfig.write_bytecode`."
msgstr ""
-#: ../../c-api/init_config.rst:1345
+#: ../../c-api/init_config.rst:1334
msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`."
msgstr ""
-#: ../../c-api/init_config.rst:1349
+#: ../../c-api/init_config.rst:1338
msgid ""
"If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` "
"arguments are parsed the same way the regular Python parses :ref:`command "
@@ -1842,27 +1829,27 @@ msgid ""
"c:member:`~PyConfig.argv`."
msgstr ""
-#: ../../c-api/init_config.rst:1354
+#: ../../c-api/init_config.rst:1343
msgid ""
"The :c:member:`~PyConfig.xoptions` options are parsed to set other options: "
"see the :option:`-X` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:1359
+#: ../../c-api/init_config.rst:1348
msgid "The ``show_alloc_count`` field has been removed."
msgstr ""
-#: ../../c-api/init_config.rst:1365
+#: ../../c-api/init_config.rst:1354
msgid "Initialization with PyConfig"
msgstr ""
-#: ../../c-api/init_config.rst:1367
+#: ../../c-api/init_config.rst:1356
msgid ""
"Initializing the interpreter from a populated configuration struct is "
"handled by calling :c:func:`Py_InitializeFromConfig`."
msgstr ""
-#: ../../c-api/init_config.rst:1373
+#: ../../c-api/init_config.rst:1362
msgid ""
"If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:"
"func:`PyImport_ExtendInittab` are used, they must be set or called after "
@@ -1871,17 +1858,17 @@ msgid ""
"`PyImport_ExtendInittab` must be called before each Python initialization."
msgstr ""
-#: ../../c-api/init_config.rst:1380
+#: ../../c-api/init_config.rst:1369
msgid ""
"The current configuration (``PyConfig`` type) is stored in "
"``PyInterpreterState.config``."
msgstr ""
-#: ../../c-api/init_config.rst:1383
+#: ../../c-api/init_config.rst:1372
msgid "Example setting the program name::"
msgstr ""
-#: ../../c-api/init_config.rst:1385
+#: ../../c-api/init_config.rst:1374
msgid ""
"void init_python(void)\n"
"{\n"
@@ -1935,7 +1922,7 @@ msgstr ""
" Py_ExitStatusException(status);\n"
"}"
-#: ../../c-api/init_config.rst:1411
+#: ../../c-api/init_config.rst:1400
msgid ""
"More complete example modifying the default configuration, read the "
"configuration, and then override some parameters. Note that since 3.11, many "
@@ -1944,7 +1931,7 @@ msgid ""
"called will be left unchanged by initialization::"
msgstr ""
-#: ../../c-api/init_config.rst:1418
+#: ../../c-api/init_config.rst:1407
msgid ""
"PyStatus init_python(const char *program_name)\n"
"{\n"
@@ -1999,18 +1986,18 @@ msgid ""
"}"
msgstr ""
-#: ../../c-api/init_config.rst:1474
+#: ../../c-api/init_config.rst:1463
msgid "Isolated Configuration"
msgstr ""
-#: ../../c-api/init_config.rst:1476
+#: ../../c-api/init_config.rst:1465
msgid ""
":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:"
"`PyConfig_InitIsolatedConfig` functions create a configuration to isolate "
"Python from the system. For example, to embed Python into an application."
msgstr ""
-#: ../../c-api/init_config.rst:1481
+#: ../../c-api/init_config.rst:1470
msgid ""
"This configuration ignores global configuration variables, environment "
"variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) "
@@ -2018,115 +2005,115 @@ msgid ""
"LC_CTYPE locale are left unchanged. Signal handlers are not installed."
msgstr ""
-#: ../../c-api/init_config.rst:1486
+#: ../../c-api/init_config.rst:1475
msgid ""
"Configuration files are still used with this configuration to determine "
"paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to "
"avoid computing the default path configuration."
msgstr ""
-#: ../../c-api/init_config.rst:1494
+#: ../../c-api/init_config.rst:1483
msgid "Python Configuration"
msgstr ""
-#: ../../c-api/init_config.rst:1496
+#: ../../c-api/init_config.rst:1485
msgid ""
":c:func:`PyPreConfig_InitPythonConfig` and :c:func:"
"`PyConfig_InitPythonConfig` functions create a configuration to build a "
"customized Python which behaves as the regular Python."
msgstr ""
-#: ../../c-api/init_config.rst:1500
+#: ../../c-api/init_config.rst:1489
msgid ""
"Environments variables and command line arguments are used to configure "
"Python, whereas global configuration variables are ignored."
msgstr ""
-#: ../../c-api/init_config.rst:1503
+#: ../../c-api/init_config.rst:1492
msgid ""
"This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 "
"Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:"
"`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables."
msgstr ""
-#: ../../c-api/init_config.rst:1512
+#: ../../c-api/init_config.rst:1501
msgid "Python Path Configuration"
msgstr ""
-#: ../../c-api/init_config.rst:1514
+#: ../../c-api/init_config.rst:1503
msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:"
msgstr ""
-#: ../../c-api/init_config.rst:1516
+#: ../../c-api/init_config.rst:1505
msgid "Path configuration inputs:"
msgstr ""
-#: ../../c-api/init_config.rst:1518
+#: ../../c-api/init_config.rst:1507
msgid ":c:member:`PyConfig.home`"
msgstr ":c:member:`PyConfig.home`"
-#: ../../c-api/init_config.rst:1519
+#: ../../c-api/init_config.rst:1508
msgid ":c:member:`PyConfig.platlibdir`"
msgstr ":c:member:`PyConfig.platlibdir`"
-#: ../../c-api/init_config.rst:1520
+#: ../../c-api/init_config.rst:1509
msgid ":c:member:`PyConfig.pathconfig_warnings`"
msgstr ":c:member:`PyConfig.pathconfig_warnings`"
-#: ../../c-api/init_config.rst:1521
+#: ../../c-api/init_config.rst:1510
msgid ":c:member:`PyConfig.program_name`"
msgstr ":c:member:`PyConfig.program_name`"
-#: ../../c-api/init_config.rst:1522
+#: ../../c-api/init_config.rst:1511
msgid ":c:member:`PyConfig.pythonpath_env`"
msgstr ":c:member:`PyConfig.pythonpath_env`"
-#: ../../c-api/init_config.rst:1523
+#: ../../c-api/init_config.rst:1512
msgid "current working directory: to get absolute paths"
msgstr ""
-#: ../../c-api/init_config.rst:1524
+#: ../../c-api/init_config.rst:1513
msgid ""
"``PATH`` environment variable to get the program full path (from :c:member:"
"`PyConfig.program_name`)"
msgstr ""
-#: ../../c-api/init_config.rst:1526
+#: ../../c-api/init_config.rst:1515
msgid "``__PYVENV_LAUNCHER__`` environment variable"
msgstr "``__PYVENV_LAUNCHER__`` 環境變數"
-#: ../../c-api/init_config.rst:1527
+#: ../../c-api/init_config.rst:1516
msgid ""
"(Windows only) Application paths in the registry under "
"\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and "
"HKEY_LOCAL_MACHINE (where X.Y is the Python version)."
msgstr ""
-#: ../../c-api/init_config.rst:1531
+#: ../../c-api/init_config.rst:1520
msgid "Path configuration output fields:"
msgstr ""
-#: ../../c-api/init_config.rst:1533
+#: ../../c-api/init_config.rst:1522
msgid ":c:member:`PyConfig.base_exec_prefix`"
msgstr ":c:member:`PyConfig.base_exec_prefix`"
-#: ../../c-api/init_config.rst:1534
+#: ../../c-api/init_config.rst:1523
msgid ":c:member:`PyConfig.base_executable`"
msgstr ":c:member:`PyConfig.base_executable`"
-#: ../../c-api/init_config.rst:1535
+#: ../../c-api/init_config.rst:1524
msgid ":c:member:`PyConfig.base_prefix`"
msgstr ":c:member:`PyConfig.base_prefix`"
-#: ../../c-api/init_config.rst:1536
+#: ../../c-api/init_config.rst:1525
msgid ":c:member:`PyConfig.exec_prefix`"
msgstr ":c:member:`PyConfig.exec_prefix`"
-#: ../../c-api/init_config.rst:1537
+#: ../../c-api/init_config.rst:1526
msgid ":c:member:`PyConfig.executable`"
msgstr ":c:member:`PyConfig.executable`"
-#: ../../c-api/init_config.rst:1538
+#: ../../c-api/init_config.rst:1527
msgid ""
":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig."
"module_search_paths`"
@@ -2134,11 +2121,11 @@ msgstr ""
":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig."
"module_search_paths`"
-#: ../../c-api/init_config.rst:1540
+#: ../../c-api/init_config.rst:1529
msgid ":c:member:`PyConfig.prefix`"
msgstr ":c:member:`PyConfig.prefix`"
-#: ../../c-api/init_config.rst:1542
+#: ../../c-api/init_config.rst:1531
msgid ""
"If at least one \"output field\" is not set, Python calculates the path "
"configuration to fill unset fields. If :c:member:`~PyConfig."
@@ -2147,7 +2134,7 @@ msgid ""
"module_search_paths_set` is set to ``1``."
msgstr ""
-#: ../../c-api/init_config.rst:1548
+#: ../../c-api/init_config.rst:1537
msgid ""
"It is possible to completely ignore the function calculating the default "
"path configuration by setting explicitly all path configuration output "
@@ -2157,52 +2144,52 @@ msgid ""
"modification."
msgstr ""
-#: ../../c-api/init_config.rst:1555
+#: ../../c-api/init_config.rst:1544
msgid ""
"Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings "
"when calculating the path configuration (Unix only, Windows does not log any "
"warning)."
msgstr ""
-#: ../../c-api/init_config.rst:1558
+#: ../../c-api/init_config.rst:1547
msgid ""
"If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig."
"base_exec_prefix` fields are not set, they inherit their value from :c:"
"member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively."
msgstr ""
-#: ../../c-api/init_config.rst:1562
+#: ../../c-api/init_config.rst:1551
msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:"
msgstr ""
-#: ../../c-api/init_config.rst:1564
+#: ../../c-api/init_config.rst:1553
msgid ""
"If :c:member:`~PyConfig.run_filename` is set and is a directory which "
"contains a ``__main__.py`` script, prepend :c:member:`~PyConfig."
"run_filename` to :data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:1567
+#: ../../c-api/init_config.rst:1556
msgid "If :c:member:`~PyConfig.isolated` is zero:"
msgstr "如果 :c:member:`~PyConfig.isolated` 為零:"
-#: ../../c-api/init_config.rst:1569
+#: ../../c-api/init_config.rst:1558
msgid ""
"If :c:member:`~PyConfig.run_module` is set, prepend the current directory "
"to :data:`sys.path`. Do nothing if the current directory cannot be read."
msgstr ""
-#: ../../c-api/init_config.rst:1571
+#: ../../c-api/init_config.rst:1560
msgid ""
"If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the "
"filename to :data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:1573
+#: ../../c-api/init_config.rst:1562
msgid "Otherwise, prepend an empty string to :data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:1575
+#: ../../c-api/init_config.rst:1564
msgid ""
"If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be "
"modified by the :mod:`site` module. If :c:member:`~PyConfig."
@@ -2211,143 +2198,143 @@ msgid ""
"data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:1581
+#: ../../c-api/init_config.rst:1570
msgid "The following configuration files are used by the path configuration:"
msgstr ""
-#: ../../c-api/init_config.rst:1583
+#: ../../c-api/init_config.rst:1572
msgid "``pyvenv.cfg``"
msgstr "``pyvenv.cfg``"
-#: ../../c-api/init_config.rst:1584
+#: ../../c-api/init_config.rst:1573
msgid "``._pth`` file (ex: ``python._pth``)"
msgstr ""
-#: ../../c-api/init_config.rst:1585
+#: ../../c-api/init_config.rst:1574
msgid "``pybuilddir.txt`` (Unix only)"
msgstr "``pybuilddir.txt``\\ (僅限 Unix)"
-#: ../../c-api/init_config.rst:1587
+#: ../../c-api/init_config.rst:1576
msgid "If a ``._pth`` file is present:"
msgstr ""
-#: ../../c-api/init_config.rst:1589
+#: ../../c-api/init_config.rst:1578
msgid "Set :c:member:`~PyConfig.isolated` to ``1``."
msgstr "將 :c:member:`~PyConfig.isolated` 設定為 ``1``。"
-#: ../../c-api/init_config.rst:1590
+#: ../../c-api/init_config.rst:1579
msgid "Set :c:member:`~PyConfig.use_environment` to ``0``."
msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。"
-#: ../../c-api/init_config.rst:1591
+#: ../../c-api/init_config.rst:1580
msgid "Set :c:member:`~PyConfig.site_import` to ``0``."
msgstr "將 :c:member:`~PyConfig.site_import` 設定為 ``0``。"
-#: ../../c-api/init_config.rst:1592
+#: ../../c-api/init_config.rst:1581
msgid "Set :c:member:`~PyConfig.safe_path` to ``1``."
msgstr "將 :c:member:`~PyConfig.safe_path` 設定為 ``1``。"
-#: ../../c-api/init_config.rst:1594
+#: ../../c-api/init_config.rst:1583
msgid ""
"The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:"
"`PyConfig.base_executable`."
msgstr ""
-#: ../../c-api/init_config.rst:1599
+#: ../../c-api/init_config.rst:1588
msgid "Py_GetArgcArgv()"
msgstr "Py_GetArgcArgv()"
-#: ../../c-api/init_config.rst:1603
+#: ../../c-api/init_config.rst:1592
msgid "Get the original command line arguments, before Python modified them."
msgstr ""
-#: ../../c-api/init_config.rst:1605
+#: ../../c-api/init_config.rst:1594
msgid "See also :c:member:`PyConfig.orig_argv` member."
msgstr "也請參與 :c:member:`PyConfig.orig_argv` 成員。"
-#: ../../c-api/init_config.rst:1609
+#: ../../c-api/init_config.rst:1598
msgid "Multi-Phase Initialization Private Provisional API"
msgstr ""
-#: ../../c-api/init_config.rst:1611
+#: ../../c-api/init_config.rst:1600
msgid ""
"This section is a private provisional API introducing multi-phase "
"initialization, the core feature of :pep:`432`:"
msgstr ""
-#: ../../c-api/init_config.rst:1614
+#: ../../c-api/init_config.rst:1603
msgid "\"Core\" initialization phase, \"bare minimum Python\":"
msgstr ""
-#: ../../c-api/init_config.rst:1616
+#: ../../c-api/init_config.rst:1605
msgid "Builtin types;"
msgstr "內建型別;"
-#: ../../c-api/init_config.rst:1617
+#: ../../c-api/init_config.rst:1606
msgid "Builtin exceptions;"
msgstr "內建例外;"
-#: ../../c-api/init_config.rst:1618
+#: ../../c-api/init_config.rst:1607
msgid "Builtin and frozen modules;"
msgstr ""
-#: ../../c-api/init_config.rst:1619
+#: ../../c-api/init_config.rst:1608
msgid ""
"The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` "
"doesn't exist yet)."
msgstr ""
-#: ../../c-api/init_config.rst:1622
+#: ../../c-api/init_config.rst:1611
msgid "\"Main\" initialization phase, Python is fully initialized:"
msgstr ""
-#: ../../c-api/init_config.rst:1624
+#: ../../c-api/init_config.rst:1613
msgid "Install and configure :mod:`importlib`;"
msgstr ""
-#: ../../c-api/init_config.rst:1625
+#: ../../c-api/init_config.rst:1614
msgid "Apply the :ref:`Path Configuration `;"
msgstr ""
-#: ../../c-api/init_config.rst:1626
+#: ../../c-api/init_config.rst:1615
msgid "Install signal handlers;"
msgstr ""
-#: ../../c-api/init_config.rst:1627
+#: ../../c-api/init_config.rst:1616
msgid ""
"Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :"
"data:`sys.path`);"
msgstr ""
-#: ../../c-api/init_config.rst:1629
+#: ../../c-api/init_config.rst:1618
msgid ""
"Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;"
msgstr ""
-#: ../../c-api/init_config.rst:1630
+#: ../../c-api/init_config.rst:1619
msgid "Import the :mod:`site` module;"
msgstr "引入 :mod:`site` 模組;"
-#: ../../c-api/init_config.rst:1631
+#: ../../c-api/init_config.rst:1620
msgid "etc."
msgstr ""
-#: ../../c-api/init_config.rst:1633
+#: ../../c-api/init_config.rst:1622
msgid "Private provisional API:"
msgstr ""
-#: ../../c-api/init_config.rst:1635
+#: ../../c-api/init_config.rst:1624
msgid ""
":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:"
"`Py_InitializeFromConfig` stops at the \"Core\" initialization phase."
msgstr ""
-#: ../../c-api/init_config.rst:1640
+#: ../../c-api/init_config.rst:1629
msgid ""
"Move to the \"Main\" initialization phase, finish the Python initialization."
msgstr ""
-#: ../../c-api/init_config.rst:1642
+#: ../../c-api/init_config.rst:1631
msgid ""
"No module is imported during the \"Core\" phase and the ``importlib`` module "
"is not configured: the :ref:`Path Configuration ` is only "
@@ -2356,14 +2343,14 @@ msgid ""
"maybe install a custom :data:`sys.meta_path` importer or an import hook, etc."
msgstr ""
-#: ../../c-api/init_config.rst:1648
+#: ../../c-api/init_config.rst:1637
msgid ""
"It may become possible to calculate the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is "
"one of the :pep:`432` motivation."
msgstr ""
-#: ../../c-api/init_config.rst:1652
+#: ../../c-api/init_config.rst:1641
msgid ""
"The \"Core\" phase is not properly defined: what should be and what should "
"not be available at this phase is not specified yet. The API is marked as "
@@ -2371,13 +2358,13 @@ msgid ""
"until a proper public API is designed."
msgstr ""
-#: ../../c-api/init_config.rst:1657
+#: ../../c-api/init_config.rst:1646
msgid ""
"Example running Python code between \"Core\" and \"Main\" initialization "
"phases::"
msgstr ""
-#: ../../c-api/init_config.rst:1660
+#: ../../c-api/init_config.rst:1649
msgid ""
"void init_python(void)\n"
"{\n"
diff --git a/c-api/intro.po b/c-api/intro.po
index 9854c7f4d0..f246ab03ee 100644
--- a/c-api/intro.po
+++ b/c-api/intro.po
@@ -1,5 +1,4 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) 2001-2022, Python Software Foundation
+# Copyright (C) 2001-2025, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
@@ -8,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-23 07:52+0800\n"
+"POT-Creation-Date: 2025-04-25 00:15+0000\n"
"PO-Revision-Date: 2023-04-25 18:01+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -33,8 +32,8 @@ msgid ""
"API. The first reason is to write *extension modules* for specific purposes; "
"these are C modules that extend the Python interpreter. This is probably "
"the most common use. The second reason is to use Python as a component in a "
-"larger application; this technique is generally referred to as :dfn:"
-"`embedding` Python in an application."
+"larger application; this technique is generally referred to "
+"as :dfn:`embedding` Python in an application."
msgstr ""
"對於 Python 的應用程式開發介面使得 C 和 C++ 開發者能夠在各種層級存取 Python "
"直譯器。該 API 同樣可用於 C++,但為簡潔起見,通常將其稱為 Python/C API。使用 "
@@ -106,8 +105,8 @@ msgstr ""
#: ../../c-api/intro.rst:54
msgid ""
"This implies inclusion of the following standard headers: ````, "
-"````, ````, ````, ```` and ```` (if available)."
+"````, ````, ````, ```` and "
+"```` (if available)."
msgstr ""
"這意味著會引入以下標準標頭:````、````、````、"
"````、```` 和 ````\\ (如果可用)。"
@@ -155,17 +154,17 @@ msgstr ""
#: ../../c-api/intro.rst:79
msgid ""
"The header files are typically installed with Python. On Unix, these are "
-"located in the directories :file:`{prefix}/include/pythonversion/` and :file:"
-"`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--prefix>` "
-"and :option:`exec_prefix <--exec-prefix>` are defined by the corresponding "
-"parameters to Python's :program:`configure` script and *version* is ``'%d."
-"%d' % sys.version_info[:2]``. On Windows, the headers are installed in :"
-"file:`{prefix}/include`, where ``prefix`` is the installation directory "
-"specified to the installer."
+"located in the directories :file:`{prefix}/include/pythonversion/` "
+"and :file:`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--"
+"prefix>` and :option:`exec_prefix <--exec-prefix>` are defined by the "
+"corresponding parameters to Python's :program:`configure` script and "
+"*version* is ``'%d.%d' % sys.version_info[:2]``. On Windows, the headers "
+"are installed in :file:`{prefix}/include`, where ``prefix`` is the "
+"installation directory specified to the installer."
msgstr ""
"標頭檔通常隨 Python 一起安裝。在 Unix 上它們位於目錄 :file:`{prefix}/include/"
-"pythonversion/` 和 :file:`{exec_prefix}/include/pythonversion/`,其中 :"
-"option:`prefix <--prefix>` 和 :option:`exec_prefix <--exec-prefix>` 由 "
+"pythonversion/` 和 :file:`{exec_prefix}/include/pythonversion/`,其"
+"中 :option:`prefix <--prefix>` 和 :option:`exec_prefix <--exec-prefix>` 由 "
"Python 的 :program:`configure` 腳本的相應參數定義,*version* 是 ``'%d.%d' % "
"sys.version_info[:2]``。在 Windows 上,標頭安裝在 :file:`{prefix}/include` "
"中,其中 ``prefix`` 是指定給安裝程式 (installer) 用的安裝目錄。"
@@ -175,14 +174,14 @@ msgid ""
"To include the headers, place both directories (if different) on your "
"compiler's search path for includes. Do *not* place the parent directories "
"on the search path and then use ``#include ``; this will "
-"break on multi-platform builds since the platform independent headers under :"
-"option:`prefix <--prefix>` include the platform specific headers from :"
-"option:`exec_prefix <--exec-prefix>`."
+"break on multi-platform builds since the platform independent headers "
+"under :option:`prefix <--prefix>` include the platform specific headers "
+"from :option:`exec_prefix <--exec-prefix>`."
msgstr ""
-"要引入標頭,請將兩個(如果不同)目錄放在編譯器的引入搜索路徑 (search path) "
-"中。*不要*\\ 將父目錄放在搜索路徑上,然後使用 ``#include ``;這會在多平台建置上壞掉,因為 :option:`prefix <--prefix>` 下獨立於平台的"
-"標頭包括來自 :option:`exec_prefix <--exec-prefix>` 的平台特定標頭。"
+"要引入標頭,請將兩個(如果不同)目錄放在編譯器的引入搜尋路徑 (search path) "
+"中。*不要*\\ 將父目錄放在搜尋路徑上,然後使用 ``#include ``;這會在多平台建置上壞掉,因為 :option:`prefix <--prefix>` 下獨立"
+"於平台的標頭包括來自 :option:`exec_prefix <--exec-prefix>` 的平台特定標頭。"
#: ../../c-api/intro.rst:95
msgid ""
@@ -204,8 +203,9 @@ msgid ""
"Others of a more general utility are defined here. This is not necessarily "
"a complete listing."
msgstr ""
-"Python 標頭檔中定義了幾個有用的巨集,大多被定義在它們有用的地方附近(例如 :c:"
-"macro:`Py_RETURN_NONE`),其他是更通用的工具程式。以下並不一定是完整的列表。"
+"Python 標頭檔中定義了幾個有用的巨集,大多被定義在它們有用的地方附近(例"
+"如 :c:macro:`Py_RETURN_NONE`),其他是更通用的工具程式。以下並不一定是完整的"
+"列表。"
#: ../../c-api/intro.rst:110
msgid ""
@@ -255,7 +255,7 @@ msgstr "回傳 ``x`` 的絕對值。"
#: ../../c-api/intro.rst:140
msgid ""
"Ask the compiler to always inline a static inline function. The compiler can "
-"ignore it and decides to not inline the function."
+"ignore it and decide to not inline the function."
msgstr ""
"要求編譯器總是嵌入靜態行內函式 (static inline function),編譯器可以忽略它並決"
"定不嵌入該函式。"
@@ -280,12 +280,13 @@ msgstr ""
#: ../../c-api/intro.rst:151
msgid ""
-"If Python is :ref:`built in debug mode ` (if the :c:macro:"
-"`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does "
-"nothing."
+"If Python is :ref:`built in debug mode ` (if "
+"the :c:macro:`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` "
+"macro does nothing."
msgstr ""
-"如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 :c:macro:"
-"`Py_DEBUG` 巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。"
+"如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如"
+"果 :c:macro:`Py_DEBUG` 巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼"
+"都不會做。"
#: ../../c-api/intro.rst:154
msgid "It must be specified before the function return type. Usage::"
@@ -345,8 +346,8 @@ msgstr "回傳 ``x`` 和 ``y`` 之間的最小值。"
#: ../../c-api/intro.rst:202
msgid ""
"Disable inlining on a function. For example, it reduces the C stack "
-"consumption: useful on LTO+PGO builds which heavily inline code (see :issue:"
-"`33720`)."
+"consumption: useful on LTO+PGO builds which heavily inline code "
+"(see :issue:`33720`)."
msgstr ""
"禁用函式的嵌入。例如,它減少了 C 堆疊的消耗:對大量嵌入程式碼的 LTO+PGO 建置"
"很有用(請參閱 :issue:`33720`)。"
@@ -391,8 +392,8 @@ msgid ""
"A use for ``Py_UNREACHABLE()`` is following a call a function that never "
"returns but that is not declared :c:macro:`_Py_NO_RETURN`."
msgstr ""
-"``Py_UNREACHABLE()`` 的一個用途是,在對一個永不回傳但並未聲明為 :c:macro:"
-"`_Py_NO_RETURN` 的函式之呼叫後使用。"
+"``Py_UNREACHABLE()`` 的一個用途是,在對一個永不回傳但並未聲明"
+"為 :c:macro:`_Py_NO_RETURN` 的函式之呼叫後使用。"
#: ../../c-api/intro.rst:233
msgid ""
@@ -476,9 +477,9 @@ msgid ""
"are treated the same way by the Python language in most situations (e.g., "
"assignments, scope rules, and argument passing), it is only fitting that "
"they should be represented by a single C type. Almost all Python objects "
-"live on the heap: you never declare an automatic or static variable of type :"
-"c:type:`PyObject`, only pointer variables of type :c:expr:`PyObject*` can "
-"be declared. The sole exception are the type objects; since these must "
+"live on the heap: you never declare an automatic or static variable of "
+"type :c:type:`PyObject`, only pointer variables of type :c:expr:`PyObject*` "
+"can be declared. The sole exception are the type objects; since these must "
"never be deallocated, they are typically static :c:type:`PyTypeObject` "
"objects."
msgstr ""
@@ -493,19 +494,20 @@ msgstr ""
#: ../../c-api/intro.rst:301
msgid ""
-"All Python objects (even Python integers) have a :dfn:`type` and a :dfn:"
-"`reference count`. An object's type determines what kind of object it is (e."
-"g., an integer, a list, or a user-defined function; there are many more as "
-"explained in :ref:`types`). For each of the well-known types there is a "
-"macro to check whether an object is of that type; for instance, "
+"All Python objects (even Python integers) have a :dfn:`type` and "
+"a :dfn:`reference count`. An object's type determines what kind of object "
+"it is (e.g., an integer, a list, or a user-defined function; there are many "
+"more as explained in :ref:`types`). For each of the well-known types there "
+"is a macro to check whether an object is of that type; for instance, "
"``PyList_Check(a)`` is true if (and only if) the object pointed to by *a* is "
"a Python list."
msgstr ""
"所有 Python 物件(甚至是 Python 整數)都有一個型別 (:dfn:`type`) 和一個參照計"
"數 (:dfn:`reference count`)。一個物件的型別決定了它是什麼種類的物件(例如一個"
-"整數、一個 list 或一個使用者定義的函式;還有更多型別,請見\\ :ref:"
-"`types`\\ )。對於每個眾所周知的型別,都有一個巨集來檢查物件是否屬於該型別;"
-"例如,若(且唯若)*a* 指向的物件是 Python list 時,``PyList_Check(a)`` 為真。"
+"整數、一個 list 或一個使用者定義的函式;還有更多型別,請見"
+"\\ :ref:`types`\\ )。對於每個眾所周知的型別,都有一個巨集來檢查物件是否屬於"
+"該型別;例如,若(且唯若)*a* 指向的物件是 Python list 時,"
+"``PyList_Check(a)`` 為真。"
#: ../../c-api/intro.rst:312
msgid "Reference Counts"
@@ -539,18 +541,18 @@ msgid ""
"Reference counts are always manipulated explicitly. The normal way is to "
"use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. "
"increment its reference count by one), and :c:func:`Py_DECREF` to release "
-"that reference (i.e. decrement the reference count by one). The :c:func:"
-"`Py_DECREF` macro is considerably more complex than the incref one, since it "
-"must check whether the reference count becomes zero and then cause the "
-"object's deallocator to be called. The deallocator is a function pointer "
-"contained in the object's type structure. The type-specific deallocator "
-"takes care of releasing references for other objects contained in the object "
-"if this is a compound object type, such as a list, as well as performing any "
-"additional finalization that's needed. There's no chance that the reference "
-"count can overflow; at least as many bits are used to hold the reference "
-"count as there are distinct memory locations in virtual memory (assuming "
-"``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the reference count "
-"increment is a simple operation."
+"that reference (i.e. decrement the reference count by one). "
+"The :c:func:`Py_DECREF` macro is considerably more complex than the incref "
+"one, since it must check whether the reference count becomes zero and then "
+"cause the object's deallocator to be called. The deallocator is a function "
+"pointer contained in the object's type structure. The type-specific "
+"deallocator takes care of releasing references for other objects contained "
+"in the object if this is a compound object type, such as a list, as well as "
+"performing any additional finalization that's needed. There's no chance "
+"that the reference count can overflow; at least as many bits are used to "
+"hold the reference count as there are distinct memory locations in virtual "
+"memory (assuming ``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the "
+"reference count increment is a simple operation."
msgstr ""
"參照計數總是被明確地操作。正常的方法是使用巨集 :c:func:`Py_INCREF` 來取得對於"
"物件的參照(即參照計數加一),並使用巨集 :c:func:`Py_DECREF` 來釋放參照(即將"
@@ -595,12 +597,12 @@ msgid ""
"conceivably remove the object from the list, releasing that reference, and "
"possibly deallocating it. The real danger is that innocent-looking "
"operations may invoke arbitrary Python code which could do this; there is a "
-"code path which allows control to flow back to the user from a :c:func:"
-"`Py_DECREF`, so almost any operation is potentially dangerous."
+"code path which allows control to flow back to the user from "
+"a :c:func:`Py_DECREF`, so almost any operation is potentially dangerous."
msgstr ""
"然而,一個常見的陷阱是從一個 list 中提取一個物件並保留它一段時間而不取得其參"
"照。某些其他操作可能會從列表中刪除該物件,減少其參照計數並可能取消分配它。真"
-"正的危險是看似無害的操作可能會呼叫可以執行此操作的任意 Python 程式碼;有一個"
+"正的危險是看似無害的操作可能會叫用可以執行此操作的任意 Python 程式碼;有一個"
"程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作都有潛"
"在危險。"
@@ -631,22 +633,22 @@ msgid ""
"shared). \"Owning a reference\" means being responsible for calling "
"Py_DECREF on it when the reference is no longer needed. Ownership can also "
"be transferred, meaning that the code that receives ownership of the "
-"reference then becomes responsible for eventually releasing it by calling :c:"
-"func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer needed---or "
-"passing on this responsibility (usually to its caller). When a function "
-"passes ownership of a reference on to its caller, the caller is said to "
-"receive a *new* reference. When no ownership is transferred, the caller is "
-"said to *borrow* the reference. Nothing needs to be done for a :term:"
-"`borrowed reference`."
+"reference then becomes responsible for eventually releasing it by "
+"calling :c:func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer "
+"needed---or passing on this responsibility (usually to its caller). When a "
+"function passes ownership of a reference on to its caller, the caller is "
+"said to receive a *new* reference. When no ownership is transferred, the "
+"caller is said to *borrow* the reference. Nothing needs to be done for "
+"a :term:`borrowed reference`."
msgstr ""
"Python/C API 中函式的參照計數行為最好用\\ *參照的所有權*\\ 來解釋。所有權附屬"
"於參照而非物件(物件並非被擁有,它們總是共享的)。「擁有參照」意味著當不再需"
"要該參照時,負責在其上呼叫 Py_DECREF。所有權也可以轉移,這意味著接收參照所有"
-"權的程式碼最終會負責在不需要參照時透過呼叫 :c:func:`Py_DECREF` 或 :c:func:"
-"`Py_XDECREF` 釋放參照 --- 或者將這個責任再傳遞出去(通常是給它的呼叫者)。當"
-"一個函式將參照的所有權傳遞給它的呼叫者時,呼叫者被稱為接收到一個\\ *新*\\ 參"
-"照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是\\ :term:`借用參"
-"照 `\\ 就不需要做任何事情。"
+"權的程式碼最終會負責在不需要參照時透過呼叫 :c:func:`Py_DECREF` "
+"或 :c:func:`Py_XDECREF` 釋放參照 --- 或者將這個責任再傳遞出去(通常是給它的呼"
+"叫者)。當一個函式將參照的所有權傳遞給它的呼叫者時,呼叫者被稱為接收到一個\\ "
+"*新*\\ 參照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是"
+"\\ :term:`借用參照 `\\ 就不需要做任何事情。"
#: ../../c-api/intro.rst:397
msgid ""
@@ -662,20 +664,20 @@ msgstr ""
#: ../../c-api/intro.rst:407
msgid ""
-"Few functions steal references; the two notable exceptions are :c:func:"
-"`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to "
-"the item (but not to the tuple or list into which the item is put!). These "
-"functions were designed to steal a reference because of a common idiom for "
-"populating a tuple or list with newly created objects; for example, the code "
-"to create the tuple ``(1, 2, \"three\")`` could look like this (forgetting "
-"about error handling for the moment; a better way to code this is shown "
-"below)::"
-msgstr ""
-"很少有函式會竊取參照;兩個值得注意的例外是 :c:func:`PyList_SetItem` 和 :c:"
-"func:`PyTuple_SetItem`,它們竊取了對項目的參照(但不是對項目所在的 tuple 或 "
-"list 的參照!)。因為有著使用新建立的物件來增加 (populate) tuple 或 list 的習"
-"慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以"
-"如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):"
+"Few functions steal references; the two notable exceptions "
+"are :c:func:`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a "
+"reference to the item (but not to the tuple or list into which the item is "
+"put!). These functions were designed to steal a reference because of a "
+"common idiom for populating a tuple or list with newly created objects; for "
+"example, the code to create the tuple ``(1, 2, \"three\")`` could look like "
+"this (forgetting about error handling for the moment; a better way to code "
+"this is shown below)::"
+msgstr ""
+"很少有函式會竊取參照;兩個值得注意的例外是 :c:func:`PyList_SetItem` "
+"和 :c:func:`PyTuple_SetItem`,它們竊取了對項目的參照(但不是對項目所在的 "
+"tuple 或 list 的參照!)。因為有著使用新建立的物件來增加 (populate) tuple 或 "
+"list 的習慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的"
+"程式碼可以如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):"
#: ../../c-api/intro.rst:415
msgid ""
@@ -700,26 +702,26 @@ msgid ""
"although the reference to it will be stolen, use :c:func:`Py_INCREF` to grab "
"another reference before calling the reference-stealing function."
msgstr ""
-"這裡 :c:func:`PyLong_FromLong` 會回傳一個新的參照,它立即被 :c:func:"
-"`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將被竊取,請"
-"在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來獲取另一個參照。"
+"這裡 :c:func:`PyLong_FromLong` 會回傳一個新的參照,它立即"
+"被 :c:func:`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將"
+"被竊取,請在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來取得另一個參照。"
#: ../../c-api/intro.rst:427
msgid ""
"Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple "
"items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to "
-"do this since tuples are an immutable data type. You should only use :c:"
-"func:`PyTuple_SetItem` for tuples that you are creating yourself."
+"do this since tuples are an immutable data type. You should only "
+"use :c:func:`PyTuple_SetItem` for tuples that you are creating yourself."
msgstr ""
-"附帶地說,:c:func:`PyTuple_SetItem` 是設定 tuple 項目的\\ *唯一*\\ 方法; :c:"
-"func:`PySequence_SetItem` 和 :c:func:`PyObject_SetItem` 拒絕這樣做,因為 "
-"tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple 使"
-"用 :c:func:`PyTuple_SetItem`。"
+"附帶地說,:c:func:`PyTuple_SetItem` 是設定 tuple 項目的\\ *唯一*\\ 方"
+"法; :c:func:`PySequence_SetItem` 和 :c:func:`PyObject_SetItem` 拒絕這樣做,"
+"因為 tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple "
+"使用 :c:func:`PyTuple_SetItem`。"
#: ../../c-api/intro.rst:432
msgid ""
-"Equivalent code for populating a list can be written using :c:func:"
-"`PyList_New` and :c:func:`PyList_SetItem`."
+"Equivalent code for populating a list can be written "
+"using :c:func:`PyList_New` and :c:func:`PyList_SetItem`."
msgstr ""
"可以使用 :c:func:`PyList_New` 和 :c:func:`PyList_SetItem` 編寫用於填充列表的"
"等效程式碼。"
@@ -727,10 +729,11 @@ msgstr ""
#: ../../c-api/intro.rst:435
msgid ""
"However, in practice, you will rarely use these ways of creating and "
-"populating a tuple or list. There's a generic function, :c:func:"
-"`Py_BuildValue`, that can create most common objects from C values, directed "
-"by a :dfn:`format string`. For example, the above two blocks of code could "
-"be replaced by the following (which also takes care of the error checking)::"
+"populating a tuple or list. There's a generic "
+"function, :c:func:`Py_BuildValue`, that can create most common objects from "
+"C values, directed by a :dfn:`format string`. For example, the above two "
+"blocks of code could be replaced by the following (which also takes care of "
+"the error checking)::"
msgstr ""
"但是在實際操作中你很少會使用這些方法來建立和增加 tuple 和 list。有一個通用函"
"式 :c:func:`Py_BuildValue` 可以從 C 值建立最常見的物件,由 :dfn:`format "
@@ -839,7 +842,7 @@ msgstr ""
"重要的是要意識到你是否擁有一個函式回傳的參照只取決於你呼叫哪個函式 --- *羽毛 "
"(plumage)*(作為引數傳遞給函式的物件之型別)\\ *不會進入它!*\\ 因此,如果你"
"使用 :c:func:`PyList_GetItem` 從 list 中提取一個項目,你不會擁有其參照 --- 但"
-"如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中獲取相同的項目(且恰好"
+"如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中取得相同的項目(且恰好"
"使用完全相同的引數),你確實會擁有對回傳物件的參照。"
#: ../../c-api/intro.rst:497
@@ -848,8 +851,8 @@ msgid ""
"of the items in a list of integers; once using :c:func:`PyList_GetItem`, "
"and once using :c:func:`PySequence_GetItem`. ::"
msgstr ""
-"以下是一個範例,說明如何編寫函式來計算一個整數 list 中項目的總和;一次使用 :"
-"c:func:`PyList_GetItem`,一次使用 :c:func:`PySequence_GetItem`: ::"
+"以下是一個範例,說明如何編寫函式來計算一個整數 list 中項目的總和;一次使"
+"用 :c:func:`PyList_GetItem`,一次使用 :c:func:`PySequence_GetItem`: ::"
#: ../../c-api/intro.rst:501
msgid ""
@@ -914,12 +917,12 @@ msgstr "型別"
#: ../../c-api/intro.rst:563
msgid ""
"There are few other data types that play a significant role in the Python/C "
-"API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:"
-"`double` and :c:expr:`char*`. A few structure types are used to describe "
-"static tables used to list the functions exported by a module or the data "
-"attributes of a new object type, and another is used to describe the value "
-"of a complex number. These will be discussed together with the functions "
-"that use them."
+"API; most are simple C types such "
+"as :c:expr:`int`, :c:expr:`long`, :c:expr:`double` and :c:expr:`char*`. A "
+"few structure types are used to describe static tables used to list the "
+"functions exported by a module or the data attributes of a new object type, "
+"and another is used to describe the value of a complex number. These will "
+"be discussed together with the functions that use them."
msgstr ""
"有少數幾個其他的資料型別在 Python/C API 中發揮重要作用;大多數是簡單的 C 型"
"別,例如 :c:expr:`int`、:c:expr:`long`、:c:expr:`double` 和 :c:expr:`char*`。"
@@ -934,8 +937,8 @@ msgid ""
"positive value of type :c:type:`Py_ssize_t`."
msgstr ""
"一個帶符號的整數型別,使得 ``sizeof(Py_ssize_t) == sizeof(size_t)``。 C99 沒"
-"有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參閱 :pep:"
-"`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。"
+"有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參"
+"閱 :pep:`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。"
#: ../../c-api/intro.rst:582
msgid "Exceptions"
@@ -979,32 +982,32 @@ msgstr ""
msgid ""
"Exception state is maintained in per-thread storage (this is equivalent to "
"using global storage in an unthreaded application). A thread can be in one "
-"of two states: an exception has occurred, or not. The function :c:func:"
-"`PyErr_Occurred` can be used to check for this: it returns a borrowed "
-"reference to the exception type object when an exception has occurred, and "
-"``NULL`` otherwise. There are a number of functions to set the exception "
-"state: :c:func:`PyErr_SetString` is the most common (though not the most "
-"general) function to set the exception state, and :c:func:`PyErr_Clear` "
-"clears the exception state."
+"of two states: an exception has occurred, or not. The "
+"function :c:func:`PyErr_Occurred` can be used to check for this: it returns "
+"a borrowed reference to the exception type object when an exception has "
+"occurred, and ``NULL`` otherwise. There are a number of functions to set "
+"the exception state: :c:func:`PyErr_SetString` is the most common (though "
+"not the most general) function to set the exception state, "
+"and :c:func:`PyErr_Clear` clears the exception state."
msgstr ""
"例外的狀態會在個別執行緒的存儲空間 (per-thread storage) 中維護(這相當於在非"
"執行緒應用程式中使用全域存儲空間)。執行緒可以處於兩種狀態之一:發生例外或未"
"發生例外。函式 :c:func:`PyErr_Occurred` 可用於檢查這一點:當例外發生時,它回"
-"傳對例外型別物件的借用參照,否則回傳 ``NULL``。設定例外狀態的函式有很多::c:"
-"func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :"
-"c:func:`PyErr_Clear` 是用來清除例外狀態。"
+"傳對例外型別物件的借用參照,否則回傳 ``NULL``。設定例外狀態的函式有很"
+"多::c:func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函"
+"式,而 :c:func:`PyErr_Clear` 是用來清除例外狀態。"
#: ../../c-api/intro.rst:617
msgid ""
"The full exception state consists of three objects (all of which can be "
"``NULL``): the exception type, the corresponding exception value, and the "
-"traceback. These have the same meanings as the Python result of ``sys."
-"exc_info()``; however, they are not the same: the Python objects represent "
-"the last exception being handled by a Python :keyword:`try` ... :keyword:"
-"`except` statement, while the C level exception state only exists while an "
-"exception is being passed on between C functions until it reaches the Python "
-"bytecode interpreter's main loop, which takes care of transferring it to "
-"``sys.exc_info()`` and friends."
+"traceback. These have the same meanings as the Python result of "
+"``sys.exc_info()``; however, they are not the same: the Python objects "
+"represent the last exception being handled by a "
+"Python :keyword:`try` ... :keyword:`except` statement, while the C level "
+"exception state only exists while an exception is being passed on between C "
+"functions until it reaches the Python bytecode interpreter's main loop, "
+"which takes care of transferring it to ``sys.exc_info()`` and friends."
msgstr ""
"完整的例外狀態由三個(都可以為 ``NULL`` 的)物件組成:例外型別、對應的例外值"
"和回溯。這些與 ``sys.exc_info()`` 的 Python 結果具有相同的含義;但是它們並不"
@@ -1016,15 +1019,15 @@ msgstr ""
#: ../../c-api/intro.rst:629
msgid ""
"Note that starting with Python 1.5, the preferred, thread-safe way to access "
-"the exception state from Python code is to call the function :func:`sys."
-"exc_info`, which returns the per-thread exception state for Python code. "
-"Also, the semantics of both ways to access the exception state have changed "
-"so that a function which catches an exception will save and restore its "
-"thread's exception state so as to preserve the exception state of its "
-"caller. This prevents common bugs in exception handling code caused by an "
-"innocent-looking function overwriting the exception being handled; it also "
-"reduces the often unwanted lifetime extension for objects that are "
-"referenced by the stack frames in the traceback."
+"the exception state from Python code is to call the "
+"function :func:`sys.exc_info`, which returns the per-thread exception state "
+"for Python code. Also, the semantics of both ways to access the exception "
+"state have changed so that a function which catches an exception will save "
+"and restore its thread's exception state so as to preserve the exception "
+"state of its caller. This prevents common bugs in exception handling code "
+"caused by an innocent-looking function overwriting the exception being "
+"handled; it also reduces the often unwanted lifetime extension for objects "
+"that are referenced by the stack frames in the traceback."
msgstr ""
"請注意,從 Python 1.5 開始,從 Python 程式碼存取例外狀態的首選且支援執行緒安"
"全的方法是呼叫 :func:`sys.exc_info` 函式,它回傳 Python 程式碼的個別執行緒例"
@@ -1123,21 +1126,22 @@ msgstr ""
#: ../../c-api/intro.rst:716
msgid ""
"This example represents an endorsed use of the ``goto`` statement in C! It "
-"illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:"
-"`PyErr_Clear` to handle specific exceptions, and the use of :c:func:"
-"`Py_XDECREF` to dispose of owned references that may be ``NULL`` (note the "
-"``'X'`` in the name; :c:func:`Py_DECREF` would crash when confronted with a "
-"``NULL`` reference). It is important that the variables used to hold owned "
-"references are initialized to ``NULL`` for this to work; likewise, the "
-"proposed return value is initialized to ``-1`` (failure) and only set to "
-"success after the final call made is successful."
-msgstr ""
-"這個例子代表了在 C 語言中對使用 ``goto`` 陳述句的認同!它闡述了以 :c:func:"
-"`PyErr_ExceptionMatches` 和 :c:func:`PyErr_Clear` 來處理特定的例外,以及以 :"
-"c:func:`Py_XDECREF` 來配置其所擁有且可能為 ``NULL`` 的參照(注意名稱中的 "
-"``'X'``\\ ;:c:func:`Py_DECREF` 在遇到 ``NULL`` 參照時會崩潰)。重要的是,用"
-"於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣地,回傳值"
-"被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成功。"
+"illustrates the use of :c:func:`PyErr_ExceptionMatches` "
+"and :c:func:`PyErr_Clear` to handle specific exceptions, and the use "
+"of :c:func:`Py_XDECREF` to dispose of owned references that may be ``NULL`` "
+"(note the ``'X'`` in the name; :c:func:`Py_DECREF` would crash when "
+"confronted with a ``NULL`` reference). It is important that the variables "
+"used to hold owned references are initialized to ``NULL`` for this to work; "
+"likewise, the proposed return value is initialized to ``-1`` (failure) and "
+"only set to success after the final call made is successful."
+msgstr ""
+"這個例子代表了在 C 語言中對使用 ``goto`` 陳述句的認同!它闡述了"
+"以 :c:func:`PyErr_ExceptionMatches` 和 :c:func:`PyErr_Clear` 來處理特定的例"
+"外,以及以 :c:func:`Py_XDECREF` 來配置其所擁有且可能為 ``NULL`` 的參照(注意"
+"名稱中的 ``'X'``\\ ;:c:func:`Py_DECREF` 在遇到 ``NULL`` 參照時會崩潰)。重要"
+"的是,用於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣"
+"地,回傳值被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成"
+"功。"
#: ../../c-api/intro.rst:730
msgid "Embedding Python"
@@ -1166,15 +1170,16 @@ msgstr ""
#: ../../c-api/intro.rst:750
msgid ""
-":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys."
-"argv``). If this variable is needed by Python code that will be executed "
-"later, setting :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` "
-"must be set: see :ref:`Python Initialization Configuration `."
+":c:func:`Py_Initialize` does not set the \"script argument list\" "
+"(``sys.argv``). If this variable is needed by Python code that will be "
+"executed later, setting :c:member:`PyConfig.argv` "
+"and :c:member:`PyConfig.parse_argv` must be set: see :ref:`Python "
+"Initialization Configuration `."
msgstr ""
-":c:func:`Py_Initialize` 不設定「腳本引數列表 (script argument list)」 (``sys."
-"argv``)。如果稍後將要執行的 Python 程式碼需要此變數,則必須設定 :c:member:"
-"`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請見 :ref:`Python 初始化"
-"配置 `。"
+":c:func:`Py_Initialize` 不設定「腳本引數列表 (script argument list)」 "
+"(``sys.argv``)。如果稍後將要執行的 Python 程式碼需要此變數,則必須設"
+"定 :c:member:`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請"
+"見 :ref:`Python 初始化配置 `。"
#: ../../c-api/intro.rst:755
msgid ""
@@ -1187,68 +1192,70 @@ msgid ""
"to the parent directory where the executable named :file:`python` is found "
"on the shell command search path (the environment variable :envvar:`PATH`)."
msgstr ""
-"在大多數系統上(特別是在 Unix 和 Windows 上,儘管細節略有不同),:c:func:"
-"`Py_Initialize` 會假設Python 函式庫相對於 Python 直譯器可執行檔案的位置固定,"
-"並根據其對標準 Python 直譯器可執行檔案位置的最佳猜測來計算模組搜索路徑。或者"
-"更詳細地說,它會在 shell 命令搜索路徑(環境變數 :envvar:`PATH`)中找到名為 :"
-"file:`python` 的可執行檔案,並在其父目錄中查找一個名為 :file:`lib/python{X.Y}"
-"` 的目錄的相對位置。"
+"在大多數系統上(特別是在 Unix 和 Windows 上,儘管細節略有不"
+"同),:c:func:`Py_Initialize` 會假設Python 函式庫相對於 Python 直譯器可執行檔"
+"案的位置固定,並根據其對標準 Python 直譯器可執行檔案位置的最佳猜測來計算模組"
+"搜尋路徑。或者更詳細地說,它會在 shell 命令搜尋路徑(環境變"
+"數 :envvar:`PATH`)中找到名為 :file:`python` 的可執行檔案,並在其父目錄中查找"
+"一個名為 :file:`lib/python{X.Y}` 的目錄的相對位置。"
#: ../../c-api/intro.rst:764
msgid ""
"For instance, if the Python executable is found in :file:`/usr/local/bin/"
"python`, it will assume that the libraries are in :file:`/usr/local/lib/"
"python{X.Y}`. (In fact, this particular path is also the \"fallback\" "
-"location, used when no executable file named :file:`python` is found along :"
-"envvar:`PATH`.) The user can override this behavior by setting the "
+"location, used when no executable file named :file:`python` is found "
+"along :envvar:`PATH`.) The user can override this behavior by setting the "
"environment variable :envvar:`PYTHONHOME`, or insert additional directories "
"in front of the standard path by setting :envvar:`PYTHONPATH`."
msgstr ""
"例如,如果在 :file:`/usr/local/bin/python` 中找到 Python 可執行檔案,它將假定"
"函式庫位於 :file:`/usr/local/lib/python{X.Y}` 中。(事實上這個特定的路徑也是"
"「後備 (fallback)」位置,當在 :envvar:`PATH` 中找不到名為 :file:`python` 的可"
-"執行檔案時使用。)使用者可以透過設定環境變數來覆蓋此行為 :envvar:"
-"`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入額外的目"
-"錄。"
+"執行檔案時使用。)使用者可以透過設定環境變數來覆蓋此行"
+"為 :envvar:`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入"
+"額外的目錄。"
#: ../../c-api/intro.rst:778
#, fuzzy
msgid ""
-"The embedding application can steer the search by setting :c:member:"
-"`PyConfig.program_name` *before* calling :c:func:`Py_InitializeFromConfig`. "
-"Note that :envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` "
-"is still inserted in front of the standard path. An application that "
-"requires total control has to provide its own implementation of :c:func:"
-"`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, and :c:"
-"func:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`)."
+"The embedding application can steer the search by "
+"setting :c:member:`PyConfig.program_name` *before* "
+"calling :c:func:`Py_InitializeFromConfig`. Note that :envvar:`PYTHONHOME` "
+"still overrides this and :envvar:`PYTHONPATH` is still inserted in front of "
+"the standard path. An application that requires total control has to "
+"provide its own implementation "
+"of :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, "
+"and :c:func:`Py_GetProgramFullPath` (all defined in :file:`Modules/"
+"getpath.c`)."
msgstr ""
"嵌入的應用程式可以透過在呼叫 :c:func:`Py_Initialize` *之前*\\ 呼叫 "
-"``Py_SetProgramName(file)`` 來引導搜索。請注意 :envvar:`PYTHONHOME` 仍然覆蓋"
+"``Py_SetProgramName(file)`` 來引導搜尋。請注意 :envvar:`PYTHONHOME` 仍然覆蓋"
"它並且 :envvar:`PYTHONPATH` 仍然插入在標準路徑的前面。需要完全控制權的應用程"
-"式必須實作自己的 :c:func:`Py_GetPath`、:c:func:`Py_GetPrefix`、:c:func:"
-"`Py_GetExecPrefix` 和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :file:"
-"`Modules/getpath.c`)。"
+"式必須實作自己"
+"的 :c:func:`Py_GetPath`、:c:func:`Py_GetPrefix`、:c:func:`Py_GetExecPrefix` "
+"和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :file:`Modules/getpath.c`)。"
#: ../../c-api/intro.rst:789
msgid ""
"Sometimes, it is desirable to \"uninitialize\" Python. For instance, the "
-"application may want to start over (make another call to :c:func:"
-"`Py_Initialize`) or the application is simply done with its use of Python "
-"and wants to free memory allocated by Python. This can be accomplished by "
-"calling :c:func:`Py_FinalizeEx`. The function :c:func:`Py_IsInitialized` "
-"returns true if Python is currently in the initialized state. More "
-"information about these functions is given in a later chapter. Notice that :"
-"c:func:`Py_FinalizeEx` does *not* free all memory allocated by the Python "
-"interpreter, e.g. memory allocated by extension modules currently cannot be "
-"released."
+"application may want to start over (make another call "
+"to :c:func:`Py_Initialize`) or the application is simply done with its use "
+"of Python and wants to free memory allocated by Python. This can be "
+"accomplished by calling :c:func:`Py_FinalizeEx`. The "
+"function :c:func:`Py_IsInitialized` returns true if Python is currently in "
+"the initialized state. More information about these functions is given in a "
+"later chapter. Notice that :c:func:`Py_FinalizeEx` does *not* free all "
+"memory allocated by the Python interpreter, e.g. memory allocated by "
+"extension modules currently cannot be released."
msgstr ""
"有時會希望能夠「取消初始化 (uninitialize)」Python。例如,應用程式可能想要重新"
"開始(再次呼叫 :c:func:`Py_Initialize`)或者應用程式簡單地完成了對 Python 的"
"使用並想要釋放 Python 分配的記憶體。這可以透過呼叫 :c:func:`Py_FinalizeEx` 來"
-"完成。如果 Python 當前處於初始化狀態,函式 :c:func:`Py_IsInitialized` 會回傳 "
-"true。有關這些功能的更多資訊將在後面的章節中給出。請注意 :c:func:"
-"`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例如目前無法釋"
-"放被擴充模組所分配的記憶體。"
+"完成。如果 Python 目前處於初始化狀態,函式 :c:func:`Py_IsInitialized` 會回傳 "
+"true。有關這些功能的更多資訊將在後面的章節中給出。請注"
+"意 :c:func:`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例"
+"如目前無法釋放被擴充模組所分配的記憶體。"
#: ../../c-api/intro.rst:803
msgid "Debugging Builds"
@@ -1265,11 +1272,11 @@ msgstr ""
#: ../../c-api/intro.rst:809
msgid ""
-"A full list of the various types of debugging builds is in the file :file:"
-"`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are "
-"available that support tracing of reference counts, debugging the memory "
-"allocator, or low-level profiling of the main interpreter loop. Only the "
-"most frequently used builds will be described in the remainder of this "
+"A full list of the various types of debugging builds is in the "
+"file :file:`Misc/SpecialBuilds.txt` in the Python source distribution. "
+"Builds are available that support tracing of reference counts, debugging the "
+"memory allocator, or low-level profiling of the main interpreter loop. Only "
+"the most frequently used builds will be described in the remainder of this "
"section."
msgstr ""
"Python 原始碼發佈版本中的 :file:`Misc/SpecialBuilds.txt` 檔案有一份包含多種除"
@@ -1280,17 +1287,17 @@ msgstr ""
msgid ""
"Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined "
"produces what is generally meant by :ref:`a debug build of Python `. :c:macro:`!Py_DEBUG` is enabled in the Unix build by adding :option:"
-"`--with-pydebug` to the :file:`./configure` command. It is also implied by "
-"the presence of the not-Python-specific :c:macro:`!_DEBUG` macro. When :c:"
-"macro:`!Py_DEBUG` is enabled in the Unix build, compiler optimization is "
-"disabled."
+"build>`. :c:macro:`!Py_DEBUG` is enabled in the Unix build by "
+"adding :option:`--with-pydebug` to the :file:`./configure` command. It is "
+"also implied by the presence of the not-Python-specific :c:macro:`!_DEBUG` "
+"macro. When :c:macro:`!Py_DEBUG` is enabled in the Unix build, compiler "
+"optimization is disabled."
msgstr ""
"使用定義的 :c:macro:`!Py_DEBUG` 巨集編譯直譯器會生成 :ref:`Python 的除錯建置 "
"`。 :c:macro:`!Py_DEBUG` 在 Unix 建置中要透過在 :file:`./"
-"configure` 命令中加入 :option:`--with-pydebug` 來啟用。非 Python 限定的 :c:"
-"macro:`!_DEBUG` 巨集的存在也暗示了這一點。當 :c:macro:`!Py_DEBUG` 在 Unix 建"
-"置中啟用時,編譯器最佳化會被禁用。"
+"configure` 命令中加入 :option:`--with-pydebug` 來啟用。非 Python 限定"
+"的 :c:macro:`!_DEBUG` 巨集的存在也暗示了這一點。當 :c:macro:`!Py_DEBUG` 在 "
+"Unix 建置中啟用時,編譯器最佳化會被禁用。"
#: ../../c-api/intro.rst:825
msgid ""
@@ -1302,26 +1309,26 @@ msgstr ""
#: ../../c-api/intro.rst:828
msgid ""
-"Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:"
-"`configure --with-trace-refs option <--with-trace-refs>`). When defined, a "
-"circular doubly linked list of active objects is maintained by adding two "
-"extra fields to every :c:type:`PyObject`. Total allocations are tracked as "
-"well. Upon exit, all existing references are printed. (In interactive mode "
-"this happens after every statement run by the interpreter.)"
+"Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see "
+"the :option:`configure --with-trace-refs option <--with-trace-refs>`). When "
+"defined, a circular doubly linked list of active objects is maintained by "
+"adding two extra fields to every :c:type:`PyObject`. Total allocations are "
+"tracked as well. Upon exit, all existing references are printed. (In "
+"interactive mode this happens after every statement run by the interpreter.)"
msgstr ""
-"定義 :c:macro:`Py_TRACE_REFS` 來啟用參照追蹤(參見\\ :option:`調用 --with-"
-"trace-refs 選項 <--with-trace-refs>`)。當有定義時,透過向每個 :c:type:"
-"`PyObject` 新增兩個額外欄位來維護有效物件的循環雙向鍊表 (circular doubly "
-"linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下,"
-"這發生在直譯器運行的每個陳述句之後。)"
+"定義 :c:macro:`Py_TRACE_REFS` 來啟用參照追蹤(參見\\ :option:`設定 --with-"
+"trace-refs 選項 <--with-trace-refs>`)。當有定義時,透過向每"
+"個 :c:type:`PyObject` 新增兩個額外欄位來維護有效物件的循環雙向鍊表 (circular "
+"doubly linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模"
+"式下,這發生在直譯器運行的每個陳述句之後。)"
#: ../../c-api/intro.rst:835
msgid ""
"Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source "
"distribution for more detailed information."
msgstr ""
-"有關更多詳細資訊,請參閱 Python 原始碼發布版中的 :file:`Misc/SpecialBuilds."
-"txt`。"
+"有關更多詳細資訊,請參閱 Python 原始碼發布版中的 :file:`Misc/"
+"SpecialBuilds.txt`。"
#: ../../c-api/intro.rst:288
msgid "object"
diff --git a/c-api/list.po b/c-api/list.po
index 8627316f79..5b7fb4a6e1 100644
--- a/c-api/list.po
+++ b/c-api/list.po
@@ -33,8 +33,8 @@ msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python list type. "
"This is the same object as :class:`list` in the Python layer."
msgstr ""
-"此 :c:type:`PyTypeObject` 實例表示 Python 的 list 型別。這與 Python 層中的 :"
-"class:`list` 是同一個物件。"
+"此 :c:type:`PyTypeObject` 實例表示 Python 的 list 型別。這與 Python 層中"
+"的 :class:`list` 是同一個物件。"
#: ../../c-api/list.rst:24
msgid ""
@@ -57,20 +57,20 @@ msgid "Return a new list of length *len* on success, or ``NULL`` on failure."
msgstr "成功時回傳長度為 *len* 的新串列,失敗時回傳 ``NULL``。"
#: ../../c-api/list.rst:40
-#, fuzzy
msgid ""
"If *len* is greater than zero, the returned list object's items are set to "
-"``NULL``. Thus you cannot use abstract API functions such as :c:func:"
-"`PySequence_SetItem` or expose the object to Python code before setting all "
-"items to a real object with :c:func:`PyList_SetItem` or :c:func:"
-"`PyList_SET_ITEM()`. The following APIs are safe APIs before the list is "
-"fully initialized: :c:func:`PyList_SetItem()` and :c:func:"
-"`PyList_SET_ITEM()`."
+"``NULL``. Thus you cannot use abstract API functions such "
+"as :c:func:`PySequence_SetItem` or expose the object to Python code before "
+"setting all items to a real object with :c:func:`PyList_SetItem` "
+"or :c:func:`PyList_SET_ITEM()`. The following APIs are safe APIs before the "
+"list is fully initialized: :c:func:`PyList_SetItem()` "
+"and :c:func:`PyList_SET_ITEM()`."
msgstr ""
-"如果 *len* 大於零,則回傳的串列物件之項目將被設定為 ``NULL``。因此,在使用 :"
-"c:func:`PyList_SetItem` 來將所有項目設定為一個真實物件前,你無法使用像是 :c:"
-"func:`PySequence_SetItem` 的使用抽象 API 函式,也不能將物件暴露 (expose) 給 "
-"Python 程式碼。"
+"如果 *len* 大於零,則回傳的串列物件之項目將被設定為 ``NULL``。因此,在使"
+"用 :c:func:`PyList_SetItem` 或 :c:func:`PyList_SET_ITEM()` 來將所有項目設定為"
+"一個真實物件前,你無法使用像是 :c:func:`PySequence_SetItem` 的抽象 API 函式,"
+"也不能將物件暴露 (expose) 給 Python 程式碼。以下 API 在串列完全初始化之前是安"
+"全的::c:func:`PyList_SetItem()` 和 :c:func:`PyList_SET_ITEM()`。"
#: ../../c-api/list.rst:53
msgid ""
@@ -83,7 +83,6 @@ msgid "Similar to :c:func:`PyList_Size`, but without error checking."
msgstr "與 :c:func:`PyList_Size` 類似,但沒有錯誤檢查。"
#: ../../c-api/list.rst:64
-#, fuzzy
msgid ""
"Return the object at position *index* in the list pointed to by *list*. The "
"position must be non-negative; indexing from the end of the list is not "
@@ -91,8 +90,8 @@ msgid ""
"``NULL`` and set an :exc:`IndexError` exception."
msgstr ""
"回傳 *list* 指向的串列中位於 *index* 位置的物件。該位置不可為負數;並不支援從"
-"串列尾末開始索引。如果 *index* 超出邊界範圍(<0 或 >=len(list))則回傳 "
-"``NULL`` 並設定 :exc:`IndexError` 例外。"
+"串列尾末開始索引。如果 *index* 超出邊界範圍 (:code:`<0 or >=len(list)`) 則回"
+"傳 ``NULL`` 並設定 :exc:`IndexError` 例外。"
#: ../../c-api/list.rst:74
msgid ""
@@ -130,15 +129,17 @@ msgstr ""
#: ../../c-api/list.rst:100
msgid ""
-"Bounds checking is performed as an assertion if Python is built in :ref:"
-"`debug mode ` or :option:`with assertions <--with-assertions>`."
+"Bounds checking is performed as an assertion if Python is built "
+"in :ref:`debug mode ` or :option:`with assertions <--with-"
+"assertions>`."
msgstr ""
#: ../../c-api/list.rst:106
msgid ""
-"This macro \"steals\" a reference to *item*, and, unlike :c:func:"
-"`PyList_SetItem`, does *not* discard a reference to any item that is being "
-"replaced; any reference in *list* at position *i* will be leaked."
+"This macro \"steals\" a reference to *item*, and, "
+"unlike :c:func:`PyList_SetItem`, does *not* discard a reference to any item "
+"that is being replaced; any reference in *list* at position *i* will be "
+"leaked."
msgstr ""
"該巨集「竊取」對 *item* 的參照,並且與 :c:func:`PyList_SetItem` 不同的是,它"
"\\ *不會*\\ 丟棄對任意被替換項目的參照;*list* 中位置 *i* 的任何參照都將被洩"
@@ -226,8 +227,8 @@ msgid ""
"Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on "
"failure. This is the equivalent of ``list.reverse()``."
msgstr ""
-"原地反轉 *list* 的項目。成功時回傳 ``0``,失敗時回傳 ``-1``。這相當於 ``list."
-"reverse()``。"
+"原地反轉 *list* 的項目。成功時回傳 ``0``,失敗時回傳 ``-1``。這相當於 "
+"``list.reverse()``。"
#: ../../c-api/list.rst:182
msgid ""
diff --git a/c-api/long.po b/c-api/long.po
index db11da07a8..0df0341414 100644
--- a/c-api/long.po
+++ b/c-api/long.po
@@ -640,11 +640,11 @@ msgstr "object(物件)"
#: ../../c-api/long.rst:8
msgid "long integer"
-msgstr "long integer(長整数)"
+msgstr "long integer(長整數)"
#: ../../c-api/long.rst:8
msgid "integer"
-msgstr "integer(整数)"
+msgstr "integer(整數)"
#: ../../c-api/long.rst:144
msgid "LONG_MAX (C macro)"
@@ -653,7 +653,7 @@ msgstr "LONG_MAX(C 巨集)"
#: ../../c-api/long.rst:144 ../../c-api/long.rst:204 ../../c-api/long.rst:247
#: ../../c-api/long.rst:262 ../../c-api/long.rst:278 ../../c-api/long.rst:294
msgid "OverflowError (built-in exception)"
-msgstr "OverflowError(内建例外)"
+msgstr "OverflowError(內建例外)"
#: ../../c-api/long.rst:247
msgid "PY_SSIZE_T_MAX (C macro)"
diff --git a/c-api/module.po b/c-api/module.po
index 7ebac731fe..8df6ee5240 100644
--- a/c-api/module.po
+++ b/c-api/module.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-02-04 00:13+0000\n"
+"POT-Creation-Date: 2025-02-25 00:14+0000\n"
"PO-Revision-Date: 2018-05-23 14:32+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -36,17 +36,18 @@ msgstr ""
#: ../../c-api/module.rst:27
msgid ""
-"Return true if *p* is a module object, but not a subtype of :c:data:"
-"`PyModule_Type`. This function always succeeds."
+"Return true if *p* is a module object, but not a subtype "
+"of :c:data:`PyModule_Type`. This function always succeeds."
msgstr ""
#: ../../c-api/module.rst:40
msgid ""
"Return a new module object with :attr:`module.__name__` set to *name*. The "
-"module's :attr:`!__name__`, :attr:`~module.__doc__`, :attr:`~module."
-"__package__` and :attr:`~module.__loader__` attributes are filled in (all "
-"but :attr:`!__name__` are set to ``None``). The caller is responsible for "
-"setting a :attr:`~module.__file__` attribute."
+"module's :attr:`!"
+"__name__`, :attr:`~module.__doc__`, :attr:`~module.__package__` "
+"and :attr:`~module.__loader__` attributes are filled in (all but :attr:`!"
+"__name__` are set to ``None``). The caller is responsible for setting "
+"a :attr:`~module.__file__` attribute."
msgstr ""
#: ../../c-api/module.rst:46 ../../c-api/module.rst:272
@@ -79,8 +80,8 @@ msgstr ""
#: ../../c-api/module.rst:70
msgid ""
"It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` "
-"functions rather than directly manipulate a module's :attr:`~object."
-"__dict__`."
+"functions rather than directly manipulate a "
+"module's :attr:`~object.__dict__`."
msgstr ""
#: ../../c-api/module.rst:81
@@ -99,8 +100,8 @@ msgstr ""
#: ../../c-api/module.rst:95
msgid ""
"Return the \"state\" of the module, that is, a pointer to the block of "
-"memory allocated at module creation time, or ``NULL``. See :c:member:"
-"`PyModuleDef.m_size`."
+"memory allocated at module creation time, or ``NULL``. "
+"See :c:member:`PyModuleDef.m_size`."
msgstr ""
#: ../../c-api/module.rst:102
@@ -111,10 +112,10 @@ msgstr ""
#: ../../c-api/module.rst:112
msgid ""
-"Return the name of the file from which *module* was loaded using *module*'s :"
-"attr:`~module.__file__` attribute. If this is not defined, or if it is not "
-"a string, raise :exc:`SystemError` and return ``NULL``; otherwise return a "
-"reference to a Unicode object."
+"Return the name of the file from which *module* was loaded using "
+"*module*'s :attr:`~module.__file__` attribute. If this is not defined, or "
+"if it is not a string, raise :exc:`SystemError` and return ``NULL``; "
+"otherwise return a reference to a Unicode object."
msgstr ""
#: ../../c-api/module.rst:122
@@ -143,9 +144,10 @@ msgstr ""
#: ../../c-api/module.rst:140
msgid ""
-"The initialization function can either pass a module definition instance to :"
-"c:func:`PyModule_Create`, and return the resulting module object, or request "
-"\"multi-phase initialization\" by returning the definition struct itself."
+"The initialization function can either pass a module definition instance "
+"to :c:func:`PyModule_Create`, and return the resulting module object, or "
+"request \"multi-phase initialization\" by returning the definition struct "
+"itself."
msgstr ""
#: ../../c-api/module.rst:146
@@ -165,8 +167,8 @@ msgstr ""
#: ../../c-api/module.rst:160
msgid ""
-"Docstring for the module; usually a docstring variable created with :c:macro:"
-"`PyDoc_STRVAR` is used."
+"Docstring for the module; usually a docstring variable created "
+"with :c:macro:`PyDoc_STRVAR` is used."
msgstr ""
#: ../../c-api/module.rst:165
@@ -179,8 +181,8 @@ msgstr ""
#: ../../c-api/module.rst:169
msgid ""
"This memory area is allocated based on *m_size* on module creation, and "
-"freed when the module object is deallocated, after the :c:member:"
-"`~PyModuleDef.m_free` function has been called, if present."
+"freed when the module object is deallocated, after "
+"the :c:member:`~PyModuleDef.m_free` function has been called, if present."
msgstr ""
#: ../../c-api/module.rst:173
@@ -203,8 +205,9 @@ msgstr "更多詳情請見 :pep:`3121`。"
#: ../../c-api/module.rst:185
msgid ""
-"A pointer to a table of module-level functions, described by :c:type:"
-"`PyMethodDef` values. Can be ``NULL`` if no functions are present."
+"A pointer to a table of module-level functions, described "
+"by :c:type:`PyMethodDef` values. Can be ``NULL`` if no functions are "
+"present."
msgstr ""
#: ../../c-api/module.rst:190
@@ -233,8 +236,8 @@ msgid ""
"allocated yet. This is the case immediately after the module is created and "
"before the module is executed (:c:data:`Py_mod_exec` function). More "
"precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is "
-"greater than 0 and the module state (as returned by :c:func:"
-"`PyModule_GetState`) is ``NULL``."
+"greater than 0 and the module state (as returned "
+"by :c:func:`PyModule_GetState`) is ``NULL``."
msgstr ""
#: ../../c-api/module.rst:213 ../../c-api/module.rst:234
@@ -277,8 +280,8 @@ msgstr ""
#: ../../c-api/module.rst:261
msgid ""
"Create a new module object, given the definition in *def*. This behaves "
-"like :c:func:`PyModule_Create2` with *module_api_version* set to :c:macro:"
-"`PYTHON_API_VERSION`."
+"like :c:func:`PyModule_Create2` with *module_api_version* set "
+"to :c:macro:`PYTHON_API_VERSION`."
msgstr ""
#: ../../c-api/module.rst:268
@@ -297,8 +300,8 @@ msgstr ""
#: ../../c-api/module.rst:279
msgid ""
"Before it is returned from in the initialization function, the resulting "
-"module object is typically populated using functions like :c:func:"
-"`PyModule_AddObjectRef`."
+"module object is typically populated using functions "
+"like :c:func:`PyModule_AddObjectRef`."
msgstr ""
#: ../../c-api/module.rst:285
@@ -323,9 +326,10 @@ msgid ""
"normal garbage collection -- as with Python modules. By default, multiple "
"modules created from the same definition should be independent: changes to "
"one should not affect the others. This means that all state should be "
-"specific to the module object (using e.g. using :c:func:"
-"`PyModule_GetState`), or its contents (such as the module's :attr:`~object."
-"__dict__` or individual classes created with :c:func:`PyType_FromSpec`)."
+"specific to the module object (using e.g. "
+"using :c:func:`PyModule_GetState`), or its contents (such as the "
+"module's :attr:`~object.__dict__` or individual classes created "
+"with :c:func:`PyType_FromSpec`)."
msgstr ""
#: ../../c-api/module.rst:304
@@ -338,9 +342,9 @@ msgstr ""
#: ../../c-api/module.rst:308
msgid ""
"To request multi-phase initialization, the initialization function "
-"(PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-empty :"
-"c:member:`~PyModuleDef.m_slots`. Before it is returned, the ``PyModuleDef`` "
-"instance must be initialized with the following function:"
+"(PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-"
+"empty :c:member:`~PyModuleDef.m_slots`. Before it is returned, the "
+"``PyModuleDef`` instance must be initialized with the following function:"
msgstr ""
#: ../../c-api/module.rst:315
@@ -412,12 +416,12 @@ msgstr ""
#: ../../c-api/module.rst:368
msgid ""
-"There is no requirement for the returned object to be an instance of :c:type:"
-"`PyModule_Type`. Any type can be used, as long as it supports setting and "
-"getting import-related attributes. However, only ``PyModule_Type`` instances "
-"may be returned if the ``PyModuleDef`` has non-``NULL`` ``m_traverse``, "
-"``m_clear``, ``m_free``; non-zero ``m_size``; or slots other than "
-"``Py_mod_create``."
+"There is no requirement for the returned object to be an instance "
+"of :c:type:`PyModule_Type`. Any type can be used, as long as it supports "
+"setting and getting import-related attributes. However, only "
+"``PyModule_Type`` instances may be returned if the ``PyModuleDef`` has non-"
+"``NULL`` ``m_traverse``, ``m_clear``, ``m_free``; non-zero ``m_size``; or "
+"slots other than ``Py_mod_create``."
msgstr ""
#: ../../c-api/module.rst:377
@@ -469,7 +473,7 @@ msgstr ""
#: ../../c-api/module.rst:417
msgid ""
"If ``Py_mod_multiple_interpreters`` is not specified, the import machinery "
-"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``."
+"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``."
msgstr ""
#: ../../c-api/module.rst:430
@@ -658,10 +662,10 @@ msgstr ""
msgid ""
"The number of different *name* strings passed to this function should be "
"kept small, usually by only using statically allocated strings as *name*. "
-"For names that aren't known at compile time, prefer calling :c:func:"
-"`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For more "
-"details, see :c:func:`PyUnicode_InternFromString`, which may be used "
-"internally to create a key object."
+"For names that aren't known at compile time, prefer "
+"calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` "
+"directly. For more details, see :c:func:`PyUnicode_InternFromString`, which "
+"may be used internally to create a key object."
msgstr ""
#: ../../c-api/module.rst:572
@@ -700,8 +704,8 @@ msgstr ""
#: ../../c-api/module.rst:601
msgid ""
-"This means that its return value must be checked, and calling code must :c:"
-"func:`Py_XDECREF` *value* manually on error."
+"This means that its return value must be checked, and calling code "
+"must :c:func:`Py_XDECREF` *value* manually on error."
msgstr ""
#: ../../c-api/module.rst:606
@@ -731,8 +735,8 @@ msgstr ""
#: ../../c-api/module.rst:628
msgid ""
-"This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:"
-"func:`PyModule_AddObjectRef`; see their documentation for details."
+"This is a convenience function that calls :c:func:`PyLong_FromLong` "
+"and :c:func:`PyModule_AddObjectRef`; see their documentation for details."
msgstr ""
#: ../../c-api/module.rst:634
@@ -745,9 +749,9 @@ msgstr ""
#: ../../c-api/module.rst:639
msgid ""
-"This is a convenience function that calls :c:func:"
-"`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their "
-"documentation for details."
+"This is a convenience function that "
+"calls :c:func:`PyUnicode_InternFromString` "
+"and :c:func:`PyModule_AddObjectRef`; see their documentation for details."
msgstr ""
#: ../../c-api/module.rst:646
@@ -760,7 +764,7 @@ msgstr ""
#: ../../c-api/module.rst:654
msgid "Add a string constant to *module*."
-msgstr ""
+msgstr "將字串常數加入到 *module* 中。"
#: ../../c-api/module.rst:658
msgid ""
@@ -811,8 +815,8 @@ msgstr ""
#: ../../c-api/module.rst:699
msgid ""
"Attaches the module object passed to the function to the interpreter state. "
-"This allows the module object to be accessible via :c:func:"
-"`PyState_FindModule`."
+"This allows the module object to be accessible "
+"via :c:func:`PyState_FindModule`."
msgstr ""
#: ../../c-api/module.rst:702
diff --git a/c-api/monitoring.po b/c-api/monitoring.po
index 67816dfd7a..ac7e58b853 100644
--- a/c-api/monitoring.po
+++ b/c-api/monitoring.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-10-22 00:13+0000\n"
+"POT-Creation-Date: 2025-03-20 00:14+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -282,3 +282,13 @@ msgstr ":monitoring-event:`STOP_ITERATION`"
msgid ""
"Exit the last scope that was entered with :c:func:`!PyMonitoring_EnterScope`."
msgstr ""
+
+#: ../../c-api/monitoring.rst:197
+msgid ""
+"Return true if the event corresponding to the event ID *ev* is a :ref:`local "
+"event `."
+msgstr ""
+
+#: ../../c-api/monitoring.rst:204
+msgid "This function is :term:`soft deprecated`."
+msgstr ""
diff --git a/c-api/none.po b/c-api/none.po
index eb714cd111..2a360b0167 100644
--- a/c-api/none.po
+++ b/c-api/none.po
@@ -38,9 +38,8 @@ msgid ""
msgstr ""
#: ../../c-api/none.rst:21
-#, fuzzy
msgid ":c:data:`Py_None` is :term:`immortal`."
-msgstr ":c:data:`Py_None` 為不滅的 (immortal)。"
+msgstr ":c:data:`Py_None` 為\\ :term:`不滅的 (immortal) `。"
#: ../../c-api/none.rst:26
msgid "Return :c:data:`Py_None` from a function."
diff --git a/c-api/object.po b/c-api/object.po
index 661f6905da..85e8adfd09 100644
--- a/c-api/object.po
+++ b/c-api/object.po
@@ -28,11 +28,11 @@ msgstr ""
#: ../../c-api/object.rst:13
msgid "Set an exception and return ``NULL`` if *constant_id* is invalid."
-msgstr ""
+msgstr "如果 *constant_id* 無效,則設定一個例外並回傳 ``NULL``。"
#: ../../c-api/object.rst:15
msgid "*constant_id* must be one of these constant identifiers:"
-msgstr ""
+msgstr "*constant_id* 必須是這些常數識別字之一:"
#: ../../c-api/object.rst:20
msgid "Constant Identifier"
@@ -135,8 +135,8 @@ msgstr ""
#: ../../c-api/object.rst:50
msgid ""
-"This function is primarily intended for backwards compatibility: using :c:"
-"func:`Py_GetConstant` is recommended for new code."
+"This function is primarily intended for backwards compatibility: "
+"using :c:func:`Py_GetConstant` is recommended for new code."
msgstr ""
#: ../../c-api/object.rst:53
@@ -154,15 +154,16 @@ msgstr ""
#: ../../c-api/object.rst:67
msgid ""
"Properly handle returning :c:data:`Py_NotImplemented` from within a C "
-"function (that is, create a new :term:`strong reference` to :const:"
-"`NotImplemented` and return it)."
+"function (that is, create a new :term:`strong reference` "
+"to :const:`NotImplemented` and return it)."
msgstr ""
#: ../../c-api/object.rst:74
msgid ""
-"Flag to be used with multiple functions that print the object (like :c:func:"
-"`PyObject_Print` and :c:func:`PyFile_WriteObject`). If passed, these "
-"function would use the :func:`str` of the object instead of the :func:`repr`."
+"Flag to be used with multiple functions that print the object "
+"(like :c:func:`PyObject_Print` and :c:func:`PyFile_WriteObject`). If passed, "
+"these function would use the :func:`str` of the object instead of "
+"the :func:`repr`."
msgstr ""
#: ../../c-api/object.rst:82
@@ -195,26 +196,27 @@ msgstr ""
#: ../../c-api/object.rst:113
msgid ""
-"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:"
-"`~object.__getattribute__` methods aren't propagated, but instead given to :"
-"func:`sys.unraisablehook`. For proper error handling, use :c:func:"
-"`PyObject_HasAttrWithError`, :c:func:`PyObject_GetOptionalAttr` or :c:func:"
-"`PyObject_GetAttr` instead."
+"Exceptions that occur when this calls :meth:`~object.__getattr__` "
+"and :meth:`~object.__getattribute__` methods aren't propagated, but instead "
+"given to :func:`sys.unraisablehook`. For proper error handling, "
+"use :c:func:`PyObject_HasAttrWithError`, :c:func:`PyObject_GetOptionalAttr` "
+"or :c:func:`PyObject_GetAttr` instead."
msgstr ""
#: ../../c-api/object.rst:122
msgid ""
"This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is specified "
-"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
-"`PyObject*`."
+"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
msgstr ""
#: ../../c-api/object.rst:128
msgid ""
-"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:"
-"`~object.__getattribute__` methods or while creating the temporary :class:"
-"`str` object are silently ignored. For proper error handling, use :c:func:"
-"`PyObject_HasAttrStringWithError`, :c:func:`PyObject_GetOptionalAttrString` "
+"Exceptions that occur when this calls :meth:`~object.__getattr__` "
+"and :meth:`~object.__getattribute__` methods or while creating the "
+"temporary :class:`str` object are silently ignored. For proper error "
+"handling, "
+"use :c:func:`PyObject_HasAttrStringWithError`, :c:func:`PyObject_GetOptionalAttrString` "
"or :c:func:`PyObject_GetAttrString` instead."
msgstr ""
@@ -227,36 +229,37 @@ msgstr ""
#: ../../c-api/object.rst:142
msgid ""
-"If the missing attribute should not be treated as a failure, you can use :c:"
-"func:`PyObject_GetOptionalAttr` instead."
+"If the missing attribute should not be treated as a failure, you can "
+"use :c:func:`PyObject_GetOptionalAttr` instead."
msgstr ""
#: ../../c-api/object.rst:148
msgid ""
"This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is specified "
-"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
-"`PyObject*`."
+"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
msgstr ""
#: ../../c-api/object.rst:152
msgid ""
-"If the missing attribute should not be treated as a failure, you can use :c:"
-"func:`PyObject_GetOptionalAttrString` instead."
+"If the missing attribute should not be treated as a failure, you can "
+"use :c:func:`PyObject_GetOptionalAttrString` instead."
msgstr ""
#: ../../c-api/object.rst:158
msgid ""
-"Variant of :c:func:`PyObject_GetAttr` which doesn't raise :exc:"
-"`AttributeError` if the attribute is not found."
+"Variant of :c:func:`PyObject_GetAttr` which doesn't "
+"raise :exc:`AttributeError` if the attribute is not found."
msgstr ""
#: ../../c-api/object.rst:161
msgid ""
-"If the attribute is found, return ``1`` and set *\\*result* to a new :term:"
-"`strong reference` to the attribute. If the attribute is not found, return "
-"``0`` and set *\\*result* to ``NULL``; the :exc:`AttributeError` is "
-"silenced. If an error other than :exc:`AttributeError` is raised, return "
-"``-1`` and set *\\*result* to ``NULL``."
+"If the attribute is found, return ``1`` and set *\\*result* to a "
+"new :term:`strong reference` to the attribute. If the attribute is not "
+"found, return ``0`` and set *\\*result* to ``NULL``; "
+"the :exc:`AttributeError` is silenced. If an error other "
+"than :exc:`AttributeError` is raised, return ``-1`` and set *\\*result* to "
+"``NULL``."
msgstr ""
#: ../../c-api/object.rst:173
@@ -270,10 +273,11 @@ msgstr ""
msgid ""
"Generic attribute getter function that is meant to be put into a type "
"object's ``tp_getattro`` slot. It looks for a descriptor in the dictionary "
-"of classes in the object's MRO as well as an attribute in the object's :attr:"
-"`~object.__dict__` (if present). As outlined in :ref:`descriptors`, data "
-"descriptors take preference over instance attributes, while non-data "
-"descriptors don't. Otherwise, an :exc:`AttributeError` is raised."
+"of classes in the object's MRO as well as an attribute in the "
+"object's :attr:`~object.__dict__` (if present). As outlined "
+"in :ref:`descriptors`, data descriptors take preference over instance "
+"attributes, while non-data descriptors don't. Otherwise, "
+"an :exc:`AttributeError` is raised."
msgstr ""
#: ../../c-api/object.rst:191
@@ -293,8 +297,8 @@ msgstr ""
#: ../../c-api/object.rst:203
msgid ""
"This is the same as :c:func:`PyObject_SetAttr`, but *attr_name* is specified "
-"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
-"`PyObject*`."
+"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
msgstr ""
#: ../../c-api/object.rst:207
@@ -307,10 +311,10 @@ msgstr ""
msgid ""
"The number of different attribute names passed to this function should be "
"kept small, usually by using a statically allocated string as *attr_name*. "
-"For attribute names that aren't known at compile time, prefer calling :c:"
-"func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For "
-"more details, see :c:func:`PyUnicode_InternFromString`, which may be used "
-"internally to create a key object."
+"For attribute names that aren't known at compile time, prefer "
+"calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` "
+"directly. For more details, see :c:func:`PyUnicode_InternFromString`, which "
+"may be used internally to create a key object."
msgstr ""
#: ../../c-api/object.rst:220
@@ -334,18 +338,18 @@ msgstr ""
#: ../../c-api/object.rst:238
msgid ""
"This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is specified "
-"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
-"`PyObject*`."
+"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
msgstr ""
#: ../../c-api/object.rst:242
msgid ""
"The number of different attribute names passed to this function should be "
"kept small, usually by using a statically allocated string as *attr_name*. "
-"For attribute names that aren't known at compile time, prefer calling :c:"
-"func:`PyUnicode_FromString` and :c:func:`PyObject_DelAttr` directly. For "
-"more details, see :c:func:`PyUnicode_InternFromString`, which may be used "
-"internally to create a key object for lookup."
+"For attribute names that aren't known at compile time, prefer "
+"calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_DelAttr` "
+"directly. For more details, see :c:func:`PyUnicode_InternFromString`, which "
+"may be used internally to create a key object for lookup."
msgstr ""
#: ../../c-api/object.rst:253
@@ -389,12 +393,12 @@ msgstr ""
#: ../../c-api/object.rst:287
msgid ""
"Compare the values of *o1* and *o2* using the operation specified by *opid*, "
-"which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :"
-"c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to "
-"``<``, ``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. This is the "
-"equivalent of the Python expression ``o1 op o2``, where ``op`` is the "
-"operator corresponding to *opid*. Returns the value of the comparison on "
-"success, or ``NULL`` on failure."
+"which must be one "
+"of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_GT`, "
+"or :c:macro:`Py_GE`, corresponding to ``<``, ``<=``, ``==``, ``!=``, ``>``, "
+"or ``>=`` respectively. This is the equivalent of the Python expression ``o1 "
+"op o2``, where ``op`` is the operator corresponding to *opid*. Returns the "
+"value of the comparison on success, or ``NULL`` on failure."
msgstr ""
#: ../../c-api/object.rst:297
@@ -440,10 +444,10 @@ msgstr ""
#: ../../c-api/object.rst:330
msgid ""
"As :c:func:`PyObject_Repr`, compute a string representation of object *o*, "
-"but escape the non-ASCII characters in the string returned by :c:func:"
-"`PyObject_Repr` with ``\\x``, ``\\u`` or ``\\U`` escapes. This generates a "
-"string similar to that returned by :c:func:`PyObject_Repr` in Python 2. "
-"Called by the :func:`ascii` built-in function."
+"but escape the non-ASCII characters in the string returned "
+"by :c:func:`PyObject_Repr` with ``\\x``, ``\\u`` or ``\\U`` escapes. This "
+"generates a string similar to that returned by :c:func:`PyObject_Repr` in "
+"Python 2. Called by the :func:`ascii` built-in function."
msgstr ""
#: ../../c-api/object.rst:341
@@ -480,8 +484,8 @@ msgstr ""
msgid ""
"If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to "
"determine the subclass status as described in :pep:`3119`. Otherwise, "
-"*derived* is a subclass of *cls* if it is a direct or indirect subclass, i."
-"e. contained in :attr:`cls.__mro__ `."
+"*derived* is a subclass of *cls* if it is a direct or indirect subclass, "
+"i.e. contained in :attr:`cls.__mro__ `."
msgstr ""
#: ../../c-api/object.rst:376
@@ -506,8 +510,8 @@ msgstr ""
#: ../../c-api/object.rst:394
msgid ""
-"An instance *inst* can override what is considered its class by having a :"
-"attr:`~object.__class__` attribute."
+"An instance *inst* can override what is considered its class by having "
+"a :attr:`~object.__class__` attribute."
msgstr ""
#: ../../c-api/object.rst:397
@@ -606,9 +610,9 @@ msgstr ""
#: ../../c-api/object.rst:498
msgid ""
-"This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :"
-"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
-"`PyObject*`."
+"This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as "
+"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
msgstr ""
#: ../../c-api/object.rst:505
@@ -617,8 +621,8 @@ msgid ""
"(possibly empty) list of strings appropriate for the object argument, or "
"``NULL`` if there was an error. If the argument is ``NULL``, this is like "
"the Python ``dir()``, returning the names of the current locals; in this "
-"case, if no execution frame is active then ``NULL`` is returned but :c:func:"
-"`PyErr_Occurred` will return false."
+"case, if no execution frame is active then ``NULL`` is returned "
+"but :c:func:`PyErr_Occurred` will return false."
msgstr ""
#: ../../c-api/object.rst:514
@@ -632,17 +636,17 @@ msgstr ""
#: ../../c-api/object.rst:522
msgid ""
"This is equivalent to the Python ``__iter__(self): return self`` method. It "
-"is intended for :term:`iterator` types, to be used in the :c:member:"
-"`PyTypeObject.tp_iter` slot."
+"is intended for :term:`iterator` types, to be used in "
+"the :c:member:`PyTypeObject.tp_iter` slot."
msgstr ""
#: ../../c-api/object.rst:528
msgid ""
-"This is the equivalent to the Python expression ``aiter(o)``. Takes an :"
-"class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. "
-"This is typically a new iterator but if the argument is an :class:"
-"`AsyncIterator`, this returns itself. Raises :exc:`TypeError` and returns "
-"``NULL`` if the object cannot be iterated."
+"This is the equivalent to the Python expression ``aiter(o)``. Takes "
+"an :class:`AsyncIterable` object and returns an :class:`AsyncIterator` for "
+"it. This is typically a new iterator but if the argument is "
+"an :class:`AsyncIterator`, this returns itself. Raises :exc:`TypeError` and "
+"returns ``NULL`` if the object cannot be iterated."
msgstr ""
#: ../../c-api/object.rst:538
@@ -658,7 +662,7 @@ msgstr ""
#: ../../c-api/object.rst:544
msgid "On error, set an exception and return ``NULL``."
-msgstr ""
+msgstr "錯誤時設定一個例外並回傳 ``NULL``。"
#: ../../c-api/object.rst:550
msgid ""
@@ -669,24 +673,24 @@ msgstr ""
#: ../../c-api/object.rst:553
msgid ""
"This may be larger than requested using :c:member:`-PyType_Spec.basicsize "
-"`; it is safe to use this larger size (e.g. with :c:"
-"func:`!memset`)."
+"`; it is safe to use this larger size (e.g. "
+"with :c:func:`!memset`)."
msgstr ""
#: ../../c-api/object.rst:556
msgid ""
-"The type *cls* **must** have been created using negative :c:member:"
-"`PyType_Spec.basicsize`. Python does not check this."
+"The type *cls* **must** have been created using "
+"negative :c:member:`PyType_Spec.basicsize`. Python does not check this."
msgstr ""
#: ../../c-api/object.rst:560
msgid "On error, set an exception and return a negative value."
-msgstr ""
+msgstr "錯誤時設定一個例外並回傳一個負值。"
#: ../../c-api/object.rst:566
msgid ""
-"Get a pointer to per-item data for a class with :c:macro:"
-"`Py_TPFLAGS_ITEMS_AT_END`."
+"Get a pointer to per-item data for a class "
+"with :c:macro:`Py_TPFLAGS_ITEMS_AT_END`."
msgstr ""
#: ../../c-api/object.rst:569
@@ -694,6 +698,8 @@ msgid ""
"On error, set an exception and return ``NULL``. :py:exc:`TypeError` is "
"raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set."
msgstr ""
+"錯誤時設定一個例外並回傳 ``NULL``。如果 *o* 沒有設"
+"定 :c:macro:`Py_TPFLAGS_ITEMS_AT_END`,則會引發 :py:exc:`TypeError`。"
#: ../../c-api/object.rst:577
msgid "Visit the managed dictionary of *obj*."
diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po
index 6c8314aa43..09e683c2bb 100644
--- a/c-api/perfmaps.po
+++ b/c-api/perfmaps.po
@@ -75,7 +75,7 @@ msgid ""
"information about the cause of a failure."
msgstr ""
"建立/打開 perf map 檔案成功時回傳 ``0``,失敗時回傳 ``-1``,建立鎖時失敗則回"
-"傳 ``-2``。檢查 ``errno`` 以獲取更多造成失敗的資訊。"
+"傳 ``-2``。檢查 ``errno`` 以取得更多造成失敗的資訊。"
#: ../../c-api/perfmaps.rst:35
msgid ""
diff --git a/c-api/refcounting.po b/c-api/refcounting.po
index d5cacea802..fa04ff0352 100644
--- a/c-api/refcounting.po
+++ b/c-api/refcounting.po
@@ -238,9 +238,9 @@ msgid ""
"object in a temporary variable, update the list data structure, and then "
"call :c:func:`Py_DECREF` for the temporary variable."
msgstr ""
-"釋放函式可以導致任意 Python 程式碼被調用(例如,當釋放具有 :meth:`~object."
+"釋放函式可以導致任意 Python 程式碼被叫用(例如,當釋放具有 :meth:`~object."
"__del__` 方法的類別實例時)。雖然此類程式碼中的例外不會被傳遞出來,但執行的程"
-"式碼可以自由存取所有 Python 全域變數。這意味著在調用 :c:func:`Py_DECREF` 之"
+"式碼可以自由存取所有 Python 全域變數。這意味著在叫用 :c:func:`Py_DECREF` 之"
"前,可從全域變數存取的任何物件都應處於一致狀態。例如,從 list 中刪除物件的程"
"式碼應將已刪除物件的參照複製到臨時變數中,更新 list 資料結構,然後為臨時變數"
"呼叫 :c:func:`Py_DECREF`。"
diff --git a/c-api/sequence.po b/c-api/sequence.po
index edb70e4c6f..88d5a0d4fa 100644
--- a/c-api/sequence.po
+++ b/c-api/sequence.po
@@ -202,7 +202,7 @@ msgstr ""
#: ../../c-api/sequence.rst:21 ../../c-api/sequence.rst:123
msgid "built-in function"
-msgstr "built-in function(内建函式)"
+msgstr "built-in function(內建函式)"
#: ../../c-api/sequence.rst:21
msgid "len"
@@ -210,4 +210,4 @@ msgstr "len"
#: ../../c-api/sequence.rst:123
msgid "tuple"
-msgstr "tuple(元组)"
+msgstr "tuple(元組)"
diff --git a/c-api/slice.po b/c-api/slice.po
index a2b3dbc7a7..fbac58a43a 100644
--- a/c-api/slice.po
+++ b/c-api/slice.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-23 07:52+0800\n"
+"POT-Creation-Date: 2025-02-18 00:13+0000\n"
"PO-Revision-Date: 2018-05-23 14:07+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -88,8 +88,8 @@ msgstr "成功時回傳 ``0`` ,在失敗時回傳 ``-1`` 並設定例外。"
#: ../../c-api/slice.rst:60
msgid ""
"This function is considered not safe for resizable sequences. Its invocation "
-"should be replaced by a combination of :c:func:`PySlice_Unpack` and :c:func:"
-"`PySlice_AdjustIndices` where ::"
+"should be replaced by a combination of :c:func:`PySlice_Unpack` "
+"and :c:func:`PySlice_AdjustIndices` where ::"
msgstr ""
#: ../../c-api/slice.rst:64
@@ -156,14 +156,20 @@ msgstr ""
#: ../../c-api/slice.rst:118
msgid "Ellipsis Object"
-msgstr ""
+msgstr "Ellipsis 物件"
#: ../../c-api/slice.rst:123
msgid ""
-"The Python ``Ellipsis`` object. This object has no methods. Like :c:data:"
-"`Py_None`, it is an :term:`immortal` singleton object."
+"The type of Python :const:`Ellipsis` object. Same "
+"as :class:`types.EllipsisType` in the Python layer."
+msgstr ""
+
+#: ../../c-api/slice.rst:129
+msgid ""
+"The Python ``Ellipsis`` object. This object has no methods. "
+"Like :c:data:`Py_None`, it is an :term:`immortal` singleton object."
msgstr ""
-#: ../../c-api/slice.rst:126
+#: ../../c-api/slice.rst:132
msgid ":c:data:`Py_Ellipsis` is immortal."
msgstr ":c:data:`Py_Ellipsis` 為不滅的 (immortal)。"
diff --git a/c-api/stable.po b/c-api/stable.po
index 5aa8323e0c..a69db51911 100644
--- a/c-api/stable.po
+++ b/c-api/stable.po
@@ -37,10 +37,10 @@ msgstr ""
#: ../../c-api/stable.rst:15
msgid ""
"CPython's Application Binary Interface (ABI) is forward- and backwards-"
-"compatible across a minor release (if these are compiled the same way; see :"
-"ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 will "
-"work on 3.10.8 and vice versa, but will need to be compiled separately for "
-"3.9.x and 3.11.x."
+"compatible across a minor release (if these are compiled the same way; "
+"see :ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 "
+"will work on 3.10.8 and vice versa, but will need to be compiled separately "
+"for 3.9.x and 3.11.x."
msgstr ""
"CPython 的應用程式二進位介面 (Application Binary Interface, ABI) 在次要版本中"
"是向前和向後相容的(如果它們以相同的方式編譯;請參閱下面的\\ :ref:`stable-"
@@ -65,8 +65,8 @@ msgid ""
"releases. When :c:macro:`Py_LIMITED_API` is defined, only this subset is "
"exposed from ``Python.h``."
msgstr ""
-":ref:`受限 API `,在多個次要版本之間相容。當有定義 :c:macro:"
-"`Py_LIMITED_API` 時,只有這個子集會從 ``Python.h`` 公開。"
+":ref:`受限 API `,在多個次要版本之間相容。當有定"
+"義 :c:macro:`Py_LIMITED_API` 時,只有這個子集會從 ``Python.h`` 公開。"
#: ../../c-api/stable.rst:29
msgid "These are discussed in more detail below."
@@ -76,14 +76,14 @@ msgstr "下面將更詳細地討論這些內容。"
msgid ""
"Names prefixed by an underscore, such as ``_Py_InternalState``, are private "
"API that can change without notice even in patch releases. If you need to "
-"use this API, consider reaching out to `CPython developers `_ to discuss adding public API for your use "
-"case."
+"use this API, consider reaching out to `CPython developers `_ to discuss adding public API for "
+"your use case."
msgstr ""
"帶有底線前綴的名稱是私有 API (private API),像是 ``_Py_InternalState``,即使"
"在補丁版本 (patch release) 中也可能被更改,不會另行通知。如果你需要使用這個 "
-"API,可以聯繫 `CPython 開發者 `_ 並針對你的使用方法來討論是否新增公開的 API。"
+"API,可以聯繫 `CPython 開發者 `_ 並針對你的使用方法來討論是否新增公開的 API。"
#: ../../c-api/stable.rst:40
msgid "Unstable C API"
@@ -156,9 +156,9 @@ msgid ""
"extension will be ABI-compatible with all Python 3 releases from the "
"specified one onward, and can use Limited API introduced up to that version."
msgstr ""
-"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:"
-"macro:`PY_VERSION_HEX` 值。該擴充與從指定版本開始的所有 Python 3 版本之 ABI "
-"相容,並且可以使用過去版本有引入的受限 API。"
+"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本"
+"的 :c:macro:`PY_VERSION_HEX` 值。該擴充與從指定版本開始的所有 Python 3 版本"
+"之 ABI 相容,並且可以使用過去版本有引入的受限 API。"
#: ../../c-api/stable.rst:83
msgid ""
@@ -211,8 +211,8 @@ msgstr ""
#: ../../c-api/stable.rst:111
msgid ""
"On Windows, extensions that use the Stable ABI should be linked against "
-"``python3.dll`` rather than a version-specific library such as ``python39."
-"dll``."
+"``python3.dll`` rather than a version-specific library such as "
+"``python39.dll``."
msgstr ""
"在 Windows 上,使用穩定 ABI 的擴充應該連接到 ``python3.dll`` 而不是特定版本的"
"函式庫,例如 ``python39.dll``。"
@@ -256,9 +256,9 @@ msgid ""
"variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because it "
"can rely on version-specific implementation details of the list object."
msgstr ""
-"例如,雖然 :c:func:`PyList_GetItem` 可用,但它的「不安全」巨集變體 :c:func:"
-"`PyList_GET_ITEM` 為不可用。巨集運行可以更快,因為它可以依賴 list 物件的特定"
-"版本實作細節。"
+"例如,雖然 :c:func:`PyList_GetItem` 可用,但它的「不安全」巨集變"
+"體 :c:func:`PyList_GET_ITEM` 為不可用。巨集運行可以更快,因為它可以依賴 list "
+"物件的特定版本實作細節。"
#: ../../c-api/stable.rst:138
msgid ""
@@ -280,7 +280,7 @@ msgid ""
"where a version-specific one is not available – for example, for prereleases "
"of an upcoming Python version."
msgstr ""
-"通過省略 ``Py_LIMITED_API`` 定義,可以使用特定版本的 ABI 編譯受限 API 擴充。"
+"透過省略 ``Py_LIMITED_API`` 定義,可以使用特定版本的 ABI 編譯受限 API 擴充。"
"這可以提高該 Python 版本的性能,但會限制相容性。使用 ``Py_LIMITED_API`` 編譯"
"將產生一個擴充,可以在特定版本的擴充不可用的地方發布 — 例如,用於即將發布的 "
"Python 版本的預發布版本 (prerelease)。"
@@ -292,9 +292,10 @@ msgstr "受限 API 注意事項"
#: ../../c-api/stable.rst:154
msgid ""
"Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee "
-"that code conforms to the :ref:`Limited API ` or the :ref:"
-"`Stable ABI `. ``Py_LIMITED_API`` only covers definitions, but "
-"an API also includes other issues, such as expected semantics."
+"that code conforms to the :ref:`Limited API ` or "
+"the :ref:`Stable ABI `. ``Py_LIMITED_API`` only covers "
+"definitions, but an API also includes other issues, such as expected "
+"semantics."
msgstr ""
"請注意,使用 ``Py_LIMITED_API`` 進行編譯\\ *不*\\ 完全保證程式碼符合\\ :ref:`"
"受限 API ` 或\\ :ref:`穩定 ABI `。"
@@ -361,9 +362,9 @@ msgstr "平台注意事項"
#: ../../c-api/stable.rst:189
msgid ""
"ABI stability depends not only on Python, but also on the compiler used, "
-"lower-level libraries and compiler options. For the purposes of the :ref:"
-"`Stable ABI `, these details define a “platform”. They usually "
-"depend on the OS type and processor architecture"
+"lower-level libraries and compiler options. For the purposes of "
+"the :ref:`Stable ABI `, these details define a “platform”. They "
+"usually depend on the OS type and processor architecture"
msgstr ""
"ABI 穩定性不僅取決於 Python,還取決於使用的編譯器、低階函式庫和編譯器選項。出"
"於\\ :ref:`穩定 ABI ` 的目的,這些細節定義了一個「平台」。它們通"
diff --git a/c-api/structures.po b/c-api/structures.po
index 76d856ee90..eacbf76707 100644
--- a/c-api/structures.po
+++ b/c-api/structures.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-23 07:52+0800\n"
+"POT-Creation-Date: 2025-03-11 00:14+0000\n"
"PO-Revision-Date: 2018-05-23 14:07+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -57,11 +57,11 @@ msgstr ""
#: ../../c-api/structures.rst:38
msgid ""
-"This is an extension of :c:type:`PyObject` that adds the :c:member:"
-"`~PyVarObject.ob_size` field. This is only used for objects that have some "
-"notion of *length*. This type does not often appear in the Python/C API. "
-"Access to the members must be done by using the macros :c:macro:"
-"`Py_REFCNT`, :c:macro:`Py_TYPE`, and :c:macro:`Py_SIZE`."
+"This is an extension of :c:type:`PyObject` that adds "
+"the :c:member:`~PyVarObject.ob_size` field. This is only used for objects "
+"that have some notion of *length*. This type does not often appear in the "
+"Python/C API. Access to the members must be done by using the "
+"macros :c:macro:`Py_REFCNT`, :c:macro:`Py_TYPE`, and :c:macro:`Py_SIZE`."
msgstr ""
#: ../../c-api/structures.rst:47
@@ -95,80 +95,85 @@ msgstr "請見上面 :c:type:`PyVarObject` 的文件。"
#: ../../c-api/structures.rst:68
msgid ""
+"The base class of all other objects, the same as :class:`object` in Python."
+msgstr ""
+
+#: ../../c-api/structures.rst:73
+msgid ""
"Test if the *x* object is the *y* object, the same as ``x is y`` in Python."
msgstr ""
-#: ../../c-api/structures.rst:75
+#: ../../c-api/structures.rst:80
msgid ""
"Test if an object is the ``None`` singleton, the same as ``x is None`` in "
"Python."
msgstr ""
-#: ../../c-api/structures.rst:83
+#: ../../c-api/structures.rst:88
msgid ""
"Test if an object is the ``True`` singleton, the same as ``x is True`` in "
"Python."
msgstr ""
-#: ../../c-api/structures.rst:91
+#: ../../c-api/structures.rst:96
msgid ""
"Test if an object is the ``False`` singleton, the same as ``x is False`` in "
"Python."
msgstr ""
-#: ../../c-api/structures.rst:99
+#: ../../c-api/structures.rst:104
msgid "Get the type of the Python object *o*."
msgstr ""
-#: ../../c-api/structures.rst:101
+#: ../../c-api/structures.rst:106
msgid "Return a :term:`borrowed reference`."
msgstr ""
-#: ../../c-api/structures.rst:103
+#: ../../c-api/structures.rst:108
msgid "Use the :c:func:`Py_SET_TYPE` function to set an object type."
msgstr ""
-#: ../../c-api/structures.rst:105
+#: ../../c-api/structures.rst:110
msgid ""
":c:func:`Py_TYPE()` is changed to an inline static function. The parameter "
"type is no longer :c:expr:`const PyObject*`."
msgstr ""
-#: ../../c-api/structures.rst:112
+#: ../../c-api/structures.rst:117
msgid ""
"Return non-zero if the object *o* type is *type*. Return zero otherwise. "
"Equivalent to: ``Py_TYPE(o) == type``."
msgstr ""
-#: ../../c-api/structures.rst:120
+#: ../../c-api/structures.rst:125
msgid "Set the object *o* type to *type*."
msgstr "將物件 *o* 的型別設為 *type*。"
-#: ../../c-api/structures.rst:127
+#: ../../c-api/structures.rst:132
msgid "Get the size of the Python object *o*."
msgstr "取得 Python 物件 *o* 的大小。"
-#: ../../c-api/structures.rst:129
+#: ../../c-api/structures.rst:134
msgid "Use the :c:func:`Py_SET_SIZE` function to set an object size."
msgstr ""
-#: ../../c-api/structures.rst:131
+#: ../../c-api/structures.rst:136
msgid ""
":c:func:`Py_SIZE()` is changed to an inline static function. The parameter "
"type is no longer :c:expr:`const PyVarObject*`."
msgstr ""
-#: ../../c-api/structures.rst:138
+#: ../../c-api/structures.rst:143
msgid "Set the object *o* size to *size*."
msgstr "將物件 *o* 的大小設為 *size*。"
-#: ../../c-api/structures.rst:145
+#: ../../c-api/structures.rst:150
msgid ""
-"This is a macro which expands to initialization values for a new :c:type:"
-"`PyObject` type. This macro expands to::"
+"This is a macro which expands to initialization values for a "
+"new :c:type:`PyObject` type. This macro expands to::"
msgstr ""
-#: ../../c-api/structures.rst:148
+#: ../../c-api/structures.rst:153
msgid ""
"_PyObject_EXTRA_INIT\n"
"1, type,"
@@ -176,14 +181,14 @@ msgstr ""
"_PyObject_EXTRA_INIT\n"
"1, type,"
-#: ../../c-api/structures.rst:154
+#: ../../c-api/structures.rst:159
msgid ""
-"This is a macro which expands to initialization values for a new :c:type:"
-"`PyVarObject` type, including the :c:member:`~PyVarObject.ob_size` field. "
-"This macro expands to::"
+"This is a macro which expands to initialization values for a "
+"new :c:type:`PyVarObject` type, including "
+"the :c:member:`~PyVarObject.ob_size` field. This macro expands to::"
msgstr ""
-#: ../../c-api/structures.rst:158
+#: ../../c-api/structures.rst:163
msgid ""
"_PyObject_EXTRA_INIT\n"
"1, type, size,"
@@ -191,11 +196,11 @@ msgstr ""
"_PyObject_EXTRA_INIT\n"
"1, type, size,"
-#: ../../c-api/structures.rst:163
+#: ../../c-api/structures.rst:168
msgid "Implementing functions and methods"
msgstr "實作函式與方法"
-#: ../../c-api/structures.rst:167
+#: ../../c-api/structures.rst:172
msgid ""
"Type of the functions used to implement most Python callables in C. "
"Functions of this type take two :c:expr:`PyObject*` parameters and return "
@@ -205,11 +210,11 @@ msgid ""
"reference."
msgstr ""
-#: ../../c-api/structures.rst:174
+#: ../../c-api/structures.rst:179
msgid "The function signature is::"
msgstr ""
-#: ../../c-api/structures.rst:176
+#: ../../c-api/structures.rst:181
msgid ""
"PyObject *PyCFunction(PyObject *self,\n"
" PyObject *args);"
@@ -217,14 +222,14 @@ msgstr ""
"PyObject *PyCFunction(PyObject *self,\n"
" PyObject *args);"
-#: ../../c-api/structures.rst:181
+#: ../../c-api/structures.rst:186
msgid ""
"Type of the functions used to implement Python callables in C with "
"signature :ref:`METH_VARARGS | METH_KEYWORDS `. "
"The function signature is::"
msgstr ""
-#: ../../c-api/structures.rst:185
+#: ../../c-api/structures.rst:190
msgid ""
"PyObject *PyCFunctionWithKeywords(PyObject *self,\n"
" PyObject *args,\n"
@@ -234,51 +239,49 @@ msgstr ""
" PyObject *args,\n"
" PyObject *kwargs);"
-#: ../../c-api/structures.rst:192
+#: ../../c-api/structures.rst:197
msgid ""
"Type of the functions used to implement Python callables in C with "
"signature :c:macro:`METH_FASTCALL`. The function signature is::"
msgstr ""
-#: ../../c-api/structures.rst:196
-#, fuzzy
+#: ../../c-api/structures.rst:201
msgid ""
"PyObject *PyCFunctionFast(PyObject *self,\n"
" PyObject *const *args,\n"
" Py_ssize_t nargs);"
msgstr ""
-"PyObject *_PyCFunctionFast(PyObject *self,\n"
-" PyObject *const *args,\n"
-" Py_ssize_t nargs);"
+"PyObject *PyCFunctionFast(PyObject *self,\n"
+" PyObject *const *args,\n"
+" Py_ssize_t nargs);"
-#: ../../c-api/structures.rst:202
+#: ../../c-api/structures.rst:207
msgid ""
"Type of the functions used to implement Python callables in C with "
"signature :ref:`METH_FASTCALL | METH_KEYWORDS `. The function signature is::"
msgstr ""
-#: ../../c-api/structures.rst:206
-#, fuzzy
+#: ../../c-api/structures.rst:211
msgid ""
"PyObject *PyCFunctionFastWithKeywords(PyObject *self,\n"
" PyObject *const *args,\n"
" Py_ssize_t nargs,\n"
" PyObject *kwnames);"
msgstr ""
-"PyObject *_PyCFunctionFastWithKeywords(PyObject *self,\n"
-" PyObject *const *args,\n"
-" Py_ssize_t nargs,\n"
-" PyObject *kwnames);"
+"PyObject *PyCFunctionFastWithKeywords(PyObject *self,\n"
+" PyObject *const *args,\n"
+" Py_ssize_t nargs,\n"
+" PyObject *kwnames);"
-#: ../../c-api/structures.rst:213
+#: ../../c-api/structures.rst:218
msgid ""
"Type of the functions used to implement Python callables in C with "
"signature :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `. The function signature is::"
msgstr ""
-#: ../../c-api/structures.rst:217
+#: ../../c-api/structures.rst:222
msgid ""
"PyObject *PyCMethod(PyObject *self,\n"
" PyTypeObject *defining_class,\n"
@@ -292,29 +295,29 @@ msgstr ""
" Py_ssize_t nargs,\n"
" PyObject *kwnames)"
-#: ../../c-api/structures.rst:228
+#: ../../c-api/structures.rst:233
msgid ""
"Structure used to describe a method of an extension type. This structure "
"has four fields:"
msgstr ""
-#: ../../c-api/structures.rst:233
+#: ../../c-api/structures.rst:238
msgid "Name of the method."
msgstr ""
-#: ../../c-api/structures.rst:237
+#: ../../c-api/structures.rst:242
msgid "Pointer to the C implementation."
msgstr ""
-#: ../../c-api/structures.rst:241
+#: ../../c-api/structures.rst:246
msgid "Flags bits indicating how the call should be constructed."
msgstr ""
-#: ../../c-api/structures.rst:245
+#: ../../c-api/structures.rst:250
msgid "Points to the contents of the docstring."
msgstr ""
-#: ../../c-api/structures.rst:247
+#: ../../c-api/structures.rst:252
msgid ""
"The :c:member:`~PyMethodDef.ml_meth` is a C function pointer. The functions "
"may be of different types, but they always return :c:expr:`PyObject*`. If "
@@ -324,41 +327,42 @@ msgid ""
"implementation uses the specific C type of the *self* object."
msgstr ""
-#: ../../c-api/structures.rst:255
+#: ../../c-api/structures.rst:260
msgid ""
"The :c:member:`~PyMethodDef.ml_flags` field is a bitfield which can include "
"the following flags. The individual flags indicate either a calling "
"convention or a binding convention."
msgstr ""
-#: ../../c-api/structures.rst:260
+#: ../../c-api/structures.rst:265
msgid "There are these calling conventions:"
msgstr ""
-#: ../../c-api/structures.rst:264
+#: ../../c-api/structures.rst:269
msgid ""
-"This is the typical calling convention, where the methods have the type :c:"
-"type:`PyCFunction`. The function expects two :c:expr:`PyObject*` values. The "
-"first one is the *self* object for methods; for module functions, it is the "
-"module object. The second parameter (often called *args*) is a tuple object "
-"representing all arguments. This parameter is typically processed using :c:"
-"func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`."
+"This is the typical calling convention, where the methods have the "
+"type :c:type:`PyCFunction`. The function expects two :c:expr:`PyObject*` "
+"values. The first one is the *self* object for methods; for module "
+"functions, it is the module object. The second parameter (often called "
+"*args*) is a tuple object representing all arguments. This parameter is "
+"typically processed using :c:func:`PyArg_ParseTuple` "
+"or :c:func:`PyArg_UnpackTuple`."
msgstr ""
-#: ../../c-api/structures.rst:274
+#: ../../c-api/structures.rst:279
msgid ""
-"Can only be used in certain combinations with other flags: :ref:"
-"`METH_VARARGS | METH_KEYWORDS `, :ref:"
-"`METH_FASTCALL | METH_KEYWORDS ` and :ref:"
-"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `."
+"Can only be used in certain combinations with other "
+"flags: :ref:`METH_VARARGS | METH_KEYWORDS `, :ref:`METH_FASTCALL | METH_KEYWORDS ` and :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS "
+"`."
msgstr ""
-#: ../../c-api/structures.rst:282
+#: ../../c-api/structures.rst:287
msgid ":c:expr:`METH_VARARGS | METH_KEYWORDS`"
msgstr ":c:expr:`METH_VARARGS | METH_KEYWORDS`"
-#: ../../c-api/structures.rst:283
+#: ../../c-api/structures.rst:288
msgid ""
"Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. "
"The function expects three parameters: *self*, *args*, *kwargs* where "
@@ -367,7 +371,7 @@ msgid ""
"using :c:func:`PyArg_ParseTupleAndKeywords`."
msgstr ""
-#: ../../c-api/structures.rst:292
+#: ../../c-api/structures.rst:297
msgid ""
"Fast calling convention supporting only positional arguments. The methods "
"have the type :c:type:`PyCFunctionFast`. The first parameter is *self*, the "
@@ -376,15 +380,15 @@ msgid ""
"the array)."
msgstr ""
-#: ../../c-api/structures.rst:302
+#: ../../c-api/structures.rst:307
msgid "``METH_FASTCALL`` is now part of the :ref:`stable ABI `."
msgstr ""
-#: ../../c-api/structures.rst:307
+#: ../../c-api/structures.rst:312
msgid ":c:expr:`METH_FASTCALL | METH_KEYWORDS`"
msgstr ":c:expr:`METH_FASTCALL | METH_KEYWORDS`"
-#: ../../c-api/structures.rst:308
+#: ../../c-api/structures.rst:313
msgid ""
"Extension of :c:macro:`METH_FASTCALL` supporting also keyword arguments, "
"with methods of type :c:type:`PyCFunctionFastWithKeywords`. Keyword "
@@ -396,17 +400,17 @@ msgid ""
"the positional arguments."
msgstr ""
-#: ../../c-api/structures.rst:323
+#: ../../c-api/structures.rst:328
msgid ""
"Can only be used in the combination with other flags: :ref:`METH_METHOD | "
"METH_FASTCALL | METH_KEYWORDS `."
msgstr ""
-#: ../../c-api/structures.rst:329
+#: ../../c-api/structures.rst:334
msgid ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`"
msgstr ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`"
-#: ../../c-api/structures.rst:330
+#: ../../c-api/structures.rst:335
msgid ""
"Extension of :ref:`METH_FASTCALL | METH_KEYWORDS ` supporting the *defining class*, that is, the class that "
@@ -414,14 +418,14 @@ msgid ""
"``Py_TYPE(self)``."
msgstr ""
-#: ../../c-api/structures.rst:335
+#: ../../c-api/structures.rst:340
msgid ""
"The method needs to be of type :c:type:`PyCMethod`, the same as for "
"``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added "
"after ``self``."
msgstr ""
-#: ../../c-api/structures.rst:344
+#: ../../c-api/structures.rst:349
msgid ""
"Methods without parameters don't need to check whether arguments are given "
"if they are listed with the :c:macro:`METH_NOARGS` flag. They need to be of "
@@ -430,22 +434,22 @@ msgid ""
"the second parameter will be ``NULL``."
msgstr ""
-#: ../../c-api/structures.rst:350
+#: ../../c-api/structures.rst:355
msgid ""
-"The function must have 2 parameters. Since the second parameter is unused, :"
-"c:macro:`Py_UNUSED` can be used to prevent a compiler warning."
+"The function must have 2 parameters. Since the second parameter is "
+"unused, :c:macro:`Py_UNUSED` can be used to prevent a compiler warning."
msgstr ""
-#: ../../c-api/structures.rst:356
+#: ../../c-api/structures.rst:361
msgid ""
-"Methods with a single object argument can be listed with the :c:macro:"
-"`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` with a "
-"``\"O\"`` argument. They have the type :c:type:`PyCFunction`, with the "
-"*self* parameter, and a :c:expr:`PyObject*` parameter representing the "
+"Methods with a single object argument can be listed with "
+"the :c:macro:`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` "
+"with a ``\"O\"`` argument. They have the type :c:type:`PyCFunction`, with "
+"the *self* parameter, and a :c:expr:`PyObject*` parameter representing the "
"single argument."
msgstr ""
-#: ../../c-api/structures.rst:362
+#: ../../c-api/structures.rst:367
msgid ""
"These two constants are not used to indicate the calling convention but the "
"binding when use with methods of classes. These may not be used for "
@@ -453,53 +457,53 @@ msgid ""
"any given method."
msgstr ""
-#: ../../c-api/structures.rst:372
+#: ../../c-api/structures.rst:377
msgid ""
"The method will be passed the type object as the first parameter rather than "
"an instance of the type. This is used to create *class methods*, similar to "
"what is created when using the :func:`classmethod` built-in function."
msgstr ""
-#: ../../c-api/structures.rst:382
+#: ../../c-api/structures.rst:387
msgid ""
"The method will be passed ``NULL`` as the first parameter rather than an "
"instance of the type. This is used to create *static methods*, similar to "
"what is created when using the :func:`staticmethod` built-in function."
msgstr ""
-#: ../../c-api/structures.rst:386
+#: ../../c-api/structures.rst:391
msgid ""
"One other constant controls whether a method is loaded in place of another "
"definition with the same method name."
msgstr ""
-#: ../../c-api/structures.rst:392
+#: ../../c-api/structures.rst:397
msgid ""
"The method will be loaded in place of existing definitions. Without "
"*METH_COEXIST*, the default is to skip repeated definitions. Since slot "
"wrappers are loaded before the method table, the existence of a "
-"*sq_contains* slot, for example, would generate a wrapped method named :meth:"
-"`~object.__contains__` and preclude the loading of a corresponding "
-"PyCFunction with the same name. With the flag defined, the PyCFunction will "
-"be loaded in place of the wrapper object and will co-exist with the slot. "
-"This is helpful because calls to PyCFunctions are optimized more than "
-"wrapper object calls."
+"*sq_contains* slot, for example, would generate a wrapped method "
+"named :meth:`~object.__contains__` and preclude the loading of a "
+"corresponding PyCFunction with the same name. With the flag defined, the "
+"PyCFunction will be loaded in place of the wrapper object and will co-exist "
+"with the slot. This is helpful because calls to PyCFunctions are optimized "
+"more than wrapper object calls."
msgstr ""
-#: ../../c-api/structures.rst:404
+#: ../../c-api/structures.rst:409
msgid ""
"Turn *ml* into a Python :term:`callable` object. The caller must ensure that "
"*ml* outlives the :term:`callable`. Typically, *ml* is defined as a static "
"variable."
msgstr ""
-#: ../../c-api/structures.rst:408
+#: ../../c-api/structures.rst:413
msgid ""
"The *self* parameter will be passed as the *self* argument to the C function "
"in ``ml->ml_meth`` when invoked. *self* can be ``NULL``."
msgstr ""
-#: ../../c-api/structures.rst:412
+#: ../../c-api/structures.rst:417
msgid ""
"The :term:`callable` object's ``__module__`` attribute can be set from the "
"given *module* argument. *module* should be a Python string, which will be "
@@ -507,89 +511,89 @@ msgid ""
"can be set to :const:`None` or ``NULL``."
msgstr ""
-#: ../../c-api/structures.rst:418
+#: ../../c-api/structures.rst:423
msgid ":attr:`function.__module__`"
msgstr ":attr:`function.__module__`"
-#: ../../c-api/structures.rst:420
+#: ../../c-api/structures.rst:425
msgid ""
"The *cls* parameter will be passed as the *defining_class* argument to the C "
"function. Must be set if :c:macro:`METH_METHOD` is set on ``ml->ml_flags``."
msgstr ""
-#: ../../c-api/structures.rst:429
+#: ../../c-api/structures.rst:434
msgid "Equivalent to ``PyCMethod_New(ml, self, module, NULL)``."
msgstr "等價於 ``PyCMethod_New(ml, self, module, NULL)``。"
-#: ../../c-api/structures.rst:434
+#: ../../c-api/structures.rst:439
msgid "Equivalent to ``PyCMethod_New(ml, self, NULL, NULL)``."
msgstr "等價於 ``PyCMethod_New(ml, self, NULL, NULL)``。"
-#: ../../c-api/structures.rst:438
+#: ../../c-api/structures.rst:443
msgid "Accessing attributes of extension types"
msgstr ""
-#: ../../c-api/structures.rst:442
+#: ../../c-api/structures.rst:447
msgid ""
"Structure which describes an attribute of a type which corresponds to a C "
"struct member. When defining a class, put a NULL-terminated array of these "
"structures in the :c:member:`~PyTypeObject.tp_members` slot."
msgstr ""
-#: ../../c-api/structures.rst:447
+#: ../../c-api/structures.rst:452
msgid "Its fields are, in order:"
msgstr ""
-#: ../../c-api/structures.rst:451
+#: ../../c-api/structures.rst:456
msgid ""
"Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array."
msgstr ""
-#: ../../c-api/structures.rst:454
+#: ../../c-api/structures.rst:459
msgid "The string should be static, no copy is made of it."
msgstr ""
-#: ../../c-api/structures.rst:458
+#: ../../c-api/structures.rst:463
msgid ""
"The type of the member in the C struct. See :ref:`PyMemberDef-types` for the "
"possible values."
msgstr ""
-#: ../../c-api/structures.rst:463
+#: ../../c-api/structures.rst:468
msgid ""
"The offset in bytes that the member is located on the type’s object struct."
msgstr ""
-#: ../../c-api/structures.rst:467
+#: ../../c-api/structures.rst:472
msgid ""
"Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR."
msgstr ""
-#: ../../c-api/structures.rst:471
+#: ../../c-api/structures.rst:476
msgid ""
"The docstring, or NULL. The string should be static, no copy is made of it. "
"Typically, it is defined using :c:macro:`PyDoc_STR`."
msgstr ""
-#: ../../c-api/structures.rst:475
+#: ../../c-api/structures.rst:480
msgid ""
"By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow "
"both read and write access. Use the :c:macro:`Py_READONLY` flag for read-"
-"only access. Certain types, like :c:macro:`Py_T_STRING`, imply :c:macro:"
-"`Py_READONLY`. Only :c:macro:`Py_T_OBJECT_EX` (and legacy :c:macro:"
-"`T_OBJECT`) members can be deleted."
+"only access. Certain types, like :c:macro:`Py_T_STRING`, "
+"imply :c:macro:`Py_READONLY`. Only :c:macro:`Py_T_OBJECT_EX` (and "
+"legacy :c:macro:`T_OBJECT`) members can be deleted."
msgstr ""
-#: ../../c-api/structures.rst:484
+#: ../../c-api/structures.rst:489
msgid ""
"For heap-allocated types (created using :c:func:`PyType_FromSpec` or "
"similar), ``PyMemberDef`` may contain a definition for the special member "
-"``\"__vectorcalloffset__\"``, corresponding to :c:member:`~PyTypeObject."
-"tp_vectorcall_offset` in type objects. These must be defined with "
-"``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::"
+"``\"__vectorcalloffset__\"``, corresponding "
+"to :c:member:`~PyTypeObject.tp_vectorcall_offset` in type objects. These "
+"must be defined with ``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::"
msgstr ""
-#: ../../c-api/structures.rst:490
+#: ../../c-api/structures.rst:495
msgid ""
"static PyMemberDef spam_type_members[] = {\n"
" {\"__vectorcalloffset__\", Py_T_PYSSIZET,\n"
@@ -603,90 +607,92 @@ msgstr ""
" {NULL} /* Sentinel */\n"
"};"
-#: ../../c-api/structures.rst:496
+#: ../../c-api/structures.rst:501
msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)"
msgstr ""
-#: ../../c-api/structures.rst:498
+#: ../../c-api/structures.rst:503
msgid ""
-"The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:"
-"`~PyTypeObject.tp_weaklistoffset` can be defined similarly using "
-"``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"`` members, but "
+"The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` "
+"and :c:member:`~PyTypeObject.tp_weaklistoffset` can be defined similarly "
+"using ``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"`` members, but "
"extensions are strongly encouraged to use :c:macro:`Py_TPFLAGS_MANAGED_DICT` "
"and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead."
msgstr ""
-#: ../../c-api/structures.rst:506
+#: ../../c-api/structures.rst:511
msgid ""
"``PyMemberDef`` is always available. Previously, it required including "
"``\"structmember.h\"``."
msgstr ""
-#: ../../c-api/structures.rst:511
+#: ../../c-api/structures.rst:516
msgid ""
"Get an attribute belonging to the object at address *obj_addr*. The "
"attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error."
msgstr ""
-#: ../../c-api/structures.rst:517
+#: ../../c-api/structures.rst:522
msgid ""
"``PyMember_GetOne`` is always available. Previously, it required including "
"``\"structmember.h\"``."
msgstr ""
-#: ../../c-api/structures.rst:522
+#: ../../c-api/structures.rst:527
msgid ""
"Set an attribute belonging to the object at address *obj_addr* to object "
"*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns "
"``0`` if successful and a negative value on failure."
msgstr ""
-#: ../../c-api/structures.rst:528
+#: ../../c-api/structures.rst:533
msgid ""
"``PyMember_SetOne`` is always available. Previously, it required including "
"``\"structmember.h\"``."
msgstr ""
-#: ../../c-api/structures.rst:534
+#: ../../c-api/structures.rst:539
msgid "Member flags"
msgstr ""
-#: ../../c-api/structures.rst:536
+#: ../../c-api/structures.rst:541
msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:"
msgstr ""
-#: ../../c-api/structures.rst:540
+#: ../../c-api/structures.rst:545
msgid "Not writable."
msgstr "不可寫入。"
-#: ../../c-api/structures.rst:544
+#: ../../c-api/structures.rst:549
msgid ""
"Emit an ``object.__getattr__`` :ref:`audit event ` before "
"reading."
msgstr ""
-#: ../../c-api/structures.rst:549
+#: ../../c-api/structures.rst:554
msgid ""
"Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` "
"entry indicates an offset from the subclass-specific data, rather than from "
"``PyObject``."
msgstr ""
-#: ../../c-api/structures.rst:553
+#: ../../c-api/structures.rst:558
msgid ""
-"Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using "
-"negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in that case."
+"Can only be used as part of :c:member:`Py_tp_members "
+"` :c:type:`slot ` when creating a "
+"class using negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in "
+"that case."
msgstr ""
-#: ../../c-api/structures.rst:558
+#: ../../c-api/structures.rst:563
msgid ""
-"This flag is only used in :c:type:`PyType_Slot`. When setting :c:member:"
-"`~PyTypeObject.tp_members` during class creation, Python clears it and sets :"
-"c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct."
+"This flag is only used in :c:type:`PyType_Slot`. When "
+"setting :c:member:`~PyTypeObject.tp_members` during class creation, Python "
+"clears it and sets :c:member:`PyMemberDef.offset` to the offset from the "
+"``PyObject`` struct."
msgstr ""
-#: ../../c-api/structures.rst:570
+#: ../../c-api/structures.rst:575
msgid ""
"The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!"
"WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are "
@@ -695,20 +701,20 @@ msgid ""
"nothing."
msgstr ""
-#: ../../c-api/structures.rst:581
+#: ../../c-api/structures.rst:586
msgid ""
-"The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:"
-"macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new "
-"names are now always available. Previously, these required ``#include "
+"The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. "
+"The :c:macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The "
+"new names are now always available. Previously, these required ``#include "
"\"structmember.h\"``. The header is still available and it provides the old "
"names."
msgstr ""
-#: ../../c-api/structures.rst:590
+#: ../../c-api/structures.rst:595
msgid "Member types"
msgstr ""
-#: ../../c-api/structures.rst:592
+#: ../../c-api/structures.rst:597
msgid ""
":c:member:`PyMemberDef.type` can be one of the following macros "
"corresponding to various C types. When the member is accessed in Python, it "
@@ -717,147 +723,147 @@ msgid ""
"exception such as :exc:`TypeError` or :exc:`ValueError` is raised."
msgstr ""
-#: ../../c-api/structures.rst:600
+#: ../../c-api/structures.rst:605
msgid ""
-"Unless marked (D), attributes defined this way cannot be deleted using e.g. :"
-"keyword:`del` or :py:func:`delattr`."
+"Unless marked (D), attributes defined this way cannot be deleted using "
+"e.g. :keyword:`del` or :py:func:`delattr`."
msgstr ""
-#: ../../c-api/structures.rst:604
+#: ../../c-api/structures.rst:609
msgid "Macro name"
msgstr "巨集名稱"
-#: ../../c-api/structures.rst:604
+#: ../../c-api/structures.rst:609
msgid "C type"
msgstr ""
-#: ../../c-api/structures.rst:604
+#: ../../c-api/structures.rst:609
msgid "Python type"
msgstr ""
-#: ../../c-api/structures.rst:606
+#: ../../c-api/structures.rst:611
msgid ":c:expr:`char`"
msgstr ":c:expr:`char`"
-#: ../../c-api/structures.rst:606 ../../c-api/structures.rst:607
-#: ../../c-api/structures.rst:608 ../../c-api/structures.rst:609
-#: ../../c-api/structures.rst:610 ../../c-api/structures.rst:611
-#: ../../c-api/structures.rst:612 ../../c-api/structures.rst:613
-#: ../../c-api/structures.rst:614 ../../c-api/structures.rst:615
-#: ../../c-api/structures.rst:616
+#: ../../c-api/structures.rst:611 ../../c-api/structures.rst:612
+#: ../../c-api/structures.rst:613 ../../c-api/structures.rst:614
+#: ../../c-api/structures.rst:615 ../../c-api/structures.rst:616
+#: ../../c-api/structures.rst:617 ../../c-api/structures.rst:618
+#: ../../c-api/structures.rst:619 ../../c-api/structures.rst:620
+#: ../../c-api/structures.rst:621
msgid ":py:class:`int`"
msgstr ":py:class:`int`"
-#: ../../c-api/structures.rst:607
+#: ../../c-api/structures.rst:612
msgid ":c:expr:`short`"
msgstr ":c:expr:`short`"
-#: ../../c-api/structures.rst:608
+#: ../../c-api/structures.rst:613
msgid ":c:expr:`int`"
msgstr ":c:expr:`int`"
-#: ../../c-api/structures.rst:609
+#: ../../c-api/structures.rst:614
msgid ":c:expr:`long`"
msgstr ":c:expr:`long`"
-#: ../../c-api/structures.rst:610
+#: ../../c-api/structures.rst:615
msgid ":c:expr:`long long`"
msgstr ":c:expr:`long long`"
-#: ../../c-api/structures.rst:611
+#: ../../c-api/structures.rst:616
msgid ":c:expr:`unsigned char`"
msgstr ":c:expr:`unsigned char`"
-#: ../../c-api/structures.rst:612
+#: ../../c-api/structures.rst:617
msgid ":c:expr:`unsigned int`"
msgstr ":c:expr:`unsigned int`"
-#: ../../c-api/structures.rst:613
+#: ../../c-api/structures.rst:618
msgid ":c:expr:`unsigned short`"
msgstr ":c:expr:`unsigned short`"
-#: ../../c-api/structures.rst:614
+#: ../../c-api/structures.rst:619
msgid ":c:expr:`unsigned long`"
msgstr ":c:expr:`unsigned long`"
-#: ../../c-api/structures.rst:615
+#: ../../c-api/structures.rst:620
msgid ":c:expr:`unsigned long long`"
msgstr ":c:expr:`unsigned long long`"
-#: ../../c-api/structures.rst:616
+#: ../../c-api/structures.rst:621
msgid ":c:expr:`Py_ssize_t`"
msgstr ":c:expr:`Py_ssize_t`"
-#: ../../c-api/structures.rst:617
+#: ../../c-api/structures.rst:622
msgid ":c:expr:`float`"
msgstr ":c:expr:`float`"
-#: ../../c-api/structures.rst:617 ../../c-api/structures.rst:618
+#: ../../c-api/structures.rst:622 ../../c-api/structures.rst:623
msgid ":py:class:`float`"
msgstr ":py:class:`float`"
-#: ../../c-api/structures.rst:618
+#: ../../c-api/structures.rst:623
msgid ":c:expr:`double`"
msgstr ":c:expr:`double`"
-#: ../../c-api/structures.rst:619
+#: ../../c-api/structures.rst:624
msgid ":c:expr:`char` (written as 0 or 1)"
msgstr ":c:expr:`char` (寫成 0 或 1)"
-#: ../../c-api/structures.rst:619
+#: ../../c-api/structures.rst:624
msgid ":py:class:`bool`"
msgstr ":py:class:`bool`"
-#: ../../c-api/structures.rst:621
+#: ../../c-api/structures.rst:626
msgid ":c:expr:`const char *` (*)"
msgstr ":c:expr:`const char *` (*)"
-#: ../../c-api/structures.rst:621 ../../c-api/structures.rst:622
+#: ../../c-api/structures.rst:626 ../../c-api/structures.rst:627
msgid ":py:class:`str` (RO)"
msgstr ":py:class:`str` (RO)"
-#: ../../c-api/structures.rst:622
+#: ../../c-api/structures.rst:627
msgid ":c:expr:`const char[]` (*)"
msgstr ":c:expr:`const char[]` (*)"
-#: ../../c-api/structures.rst:623
+#: ../../c-api/structures.rst:628
msgid ":c:expr:`char` (0-127)"
msgstr ":c:expr:`char` (0-127)"
-#: ../../c-api/structures.rst:623
+#: ../../c-api/structures.rst:628
msgid ":py:class:`str` (**)"
msgstr ":py:class:`str` (**)"
-#: ../../c-api/structures.rst:624
+#: ../../c-api/structures.rst:629
msgid ":c:expr:`PyObject *`"
msgstr ":c:expr:`PyObject *`"
-#: ../../c-api/structures.rst:624
+#: ../../c-api/structures.rst:629
msgid ":py:class:`object` (D)"
msgstr ":py:class:`object` (D)"
-#: ../../c-api/structures.rst:627
+#: ../../c-api/structures.rst:632
msgid ""
"(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` "
"the C representation is a pointer; with :c:macro:`!Py_T_STRING_INPLACE` the "
"string is stored directly in the structure."
msgstr ""
-#: ../../c-api/structures.rst:632
+#: ../../c-api/structures.rst:637
msgid "(**): String of length 1. Only ASCII is accepted."
msgstr ""
-#: ../../c-api/structures.rst:634
+#: ../../c-api/structures.rst:639
msgid "(RO): Implies :c:macro:`Py_READONLY`."
msgstr ""
-#: ../../c-api/structures.rst:636
+#: ../../c-api/structures.rst:641
msgid ""
"(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a "
"``NULL`` pointer raises :py:exc:`AttributeError`."
msgstr ""
-#: ../../c-api/structures.rst:662
+#: ../../c-api/structures.rst:667
msgid ""
"In previous versions, the macros were only available with ``#include "
"\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as "
@@ -865,174 +871,174 @@ msgid ""
"with the following deprecated types:"
msgstr ""
-#: ../../c-api/structures.rst:670
+#: ../../c-api/structures.rst:675
msgid ""
"Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results "
"in surprising behavior in Python: deleting the attribute effectively sets it "
"to ``None``."
msgstr ""
-#: ../../c-api/structures.rst:676
+#: ../../c-api/structures.rst:681
msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`."
msgstr ""
-#: ../../c-api/structures.rst:679
+#: ../../c-api/structures.rst:684
msgid "Defining Getters and Setters"
msgstr ""
-#: ../../c-api/structures.rst:683
+#: ../../c-api/structures.rst:688
msgid ""
"Structure to define property-like access for a type. See also description of "
"the :c:member:`PyTypeObject.tp_getset` slot."
msgstr ""
-#: ../../c-api/structures.rst:688
+#: ../../c-api/structures.rst:693
msgid "attribute name"
msgstr "屬性名稱"
-#: ../../c-api/structures.rst:692
+#: ../../c-api/structures.rst:697
msgid "C function to get the attribute."
msgstr ""
-#: ../../c-api/structures.rst:696
+#: ../../c-api/structures.rst:701
msgid ""
"Optional C function to set or delete the attribute. If ``NULL``, the "
"attribute is read-only."
msgstr ""
-#: ../../c-api/structures.rst:701
+#: ../../c-api/structures.rst:706
msgid "optional docstring"
msgstr "可選的文件字串"
-#: ../../c-api/structures.rst:705
+#: ../../c-api/structures.rst:710
msgid ""
"Optional user data pointer, providing additional data for getter and setter."
msgstr ""
-#: ../../c-api/structures.rst:709
+#: ../../c-api/structures.rst:714
msgid ""
"The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) "
"and a user data pointer (the associated ``closure``):"
msgstr ""
-#: ../../c-api/structures.rst:712
+#: ../../c-api/structures.rst:717
msgid ""
"It should return a new reference on success or ``NULL`` with a set exception "
"on failure."
msgstr ""
-#: ../../c-api/structures.rst:717
+#: ../../c-api/structures.rst:722
msgid ""
"``set`` functions take two :c:expr:`PyObject*` parameters (the instance and "
"the value to be set) and a user data pointer (the associated ``closure``):"
msgstr ""
-#: ../../c-api/structures.rst:720
+#: ../../c-api/structures.rst:725
msgid ""
"In case the attribute should be deleted the second parameter is ``NULL``. "
"Should return ``0`` on success or ``-1`` with a set exception on failure."
msgstr ""
-#: ../../c-api/structures.rst:370 ../../c-api/structures.rst:380
+#: ../../c-api/structures.rst:375 ../../c-api/structures.rst:385
msgid "built-in function"
msgstr "built-in function(內建函式)"
-#: ../../c-api/structures.rst:370
+#: ../../c-api/structures.rst:375
msgid "classmethod"
msgstr "classmethod"
-#: ../../c-api/structures.rst:380
+#: ../../c-api/structures.rst:385
msgid "staticmethod"
msgstr "staticmethod"
-#: ../../c-api/structures.rst:563
+#: ../../c-api/structures.rst:568
msgid "READ_RESTRICTED (C macro)"
msgstr "READ_RESTRICTED(C 巨集)"
-#: ../../c-api/structures.rst:563
+#: ../../c-api/structures.rst:568
msgid "WRITE_RESTRICTED (C macro)"
msgstr "WRITE_RESTRICTED(C 巨集)"
-#: ../../c-api/structures.rst:563
+#: ../../c-api/structures.rst:568
msgid "RESTRICTED (C macro)"
msgstr "RESTRICTED(C 巨集)"
-#: ../../c-api/structures.rst:576
+#: ../../c-api/structures.rst:581
msgid "READONLY (C macro)"
msgstr "READONLY(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_BYTE (C macro)"
msgstr "T_BYTE(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_SHORT (C macro)"
msgstr "T_SHORT(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_INT (C macro)"
msgstr "T_INT(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_LONG (C macro)"
msgstr "T_LONG(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_LONGLONG (C macro)"
msgstr "T_LONGLONG(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_UBYTE (C macro)"
msgstr "T_UBYTE(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_USHORT (C macro)"
msgstr "T_USHORT(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_UINT (C macro)"
msgstr "T_UINT(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_ULONG (C macro)"
msgstr "T_ULONG(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_ULONGULONG (C macro)"
msgstr "T_ULONGULONG(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_PYSSIZET (C macro)"
msgstr "T_PYSSIZET(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_FLOAT (C macro)"
msgstr "T_FLOAT(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_DOUBLE (C macro)"
msgstr "T_DOUBLE(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_BOOL (C macro)"
msgstr "T_BOOL(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_CHAR (C macro)"
msgstr "T_CHAR(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_STRING (C macro)"
msgstr "T_STRING(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_STRING_INPLACE (C macro)"
msgstr "T_STRING_INPLACE(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "T_OBJECT_EX (C macro)"
msgstr "T_OBJECT_EX(C 巨集)"
-#: ../../c-api/structures.rst:639
+#: ../../c-api/structures.rst:644
msgid "structmember.h"
msgstr "structmember.h"
diff --git a/c-api/time.po b/c-api/time.po
index a3c2646b3a..401edfe389 100644
--- a/c-api/time.po
+++ b/c-api/time.po
@@ -1,14 +1,15 @@
-# Copyright (C) 2001-2024, Python Software Foundation
+# Copyright (C) 2001-2025, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
-#, fuzzy
+# Translators:
+# Matt Wang , 2025
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-24 07:20+0000\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME \n"
+"PO-Revision-Date: 2025-05-25 04:26+0800\n"
+"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
@@ -24,28 +25,31 @@ msgstr "PyTime C API"
msgid ""
"The clock C API provides access to system clocks. It is similar to the "
"Python :mod:`time` module."
-msgstr ""
+msgstr "時鐘 C API 提供對系統時鐘的存取。它類似於 Python 的 :mod:`time` 模組。"
#: ../../c-api/time.rst:13
msgid ""
"For C API related to the :mod:`datetime` module, see :ref:`datetimeobjects`."
msgstr ""
+"對於與 :mod:`datetime` 模組相關的 C API,請參閱 :ref:`datetimeobjects`。"
#: ../../c-api/time.rst:17
msgid "Types"
-msgstr ""
+msgstr "型別"
#: ../../c-api/time.rst:21
msgid ""
"A timestamp or duration in nanoseconds, represented as a signed 64-bit "
"integer."
-msgstr ""
+msgstr "以奈秒為單位的時間戳記或持續時長,以有符號的 64 位元整數表示。"
#: ../../c-api/time.rst:24
msgid ""
-"The reference point for timestamps depends on the clock used. For example, :"
-"c:func:`PyTime_Time` returns timestamps relative to the UNIX epoch."
+"The reference point for timestamps depends on the clock used. For "
+"example, :c:func:`PyTime_Time` returns timestamps relative to the UNIX epoch."
msgstr ""
+"時間戳記的參照點取決於所使用的時鐘。例如 :c:func:`PyTime_Time` 回傳相對於 "
+"UNIX 紀元 (UNIX epoch) 的時間戳記。"
#: ../../c-api/time.rst:27
msgid ""
@@ -53,18 +57,21 @@ msgid ""
"epoch (January 1st, 1970) as reference, the supported date range is around "
"[1677-09-21; 2262-04-11]. The exact limits are exposed as constants:"
msgstr ""
+"支援的範圍約為 [-292.3 年;+292.3 年]。以 Unix 紀元 (1970 年 1 月 1 日) 為參"
+"照,支援的日期範圍約為 [1677-09-21; 2262-04-11]。確切的限制是以常數的形式公開"
+"出來:"
#: ../../c-api/time.rst:34
msgid "Minimum value of :c:type:`PyTime_t`."
-msgstr ""
+msgstr ":c:type:`PyTime_t` 的最小值。"
#: ../../c-api/time.rst:38
msgid "Maximum value of :c:type:`PyTime_t`."
-msgstr ""
+msgstr ":c:type:`PyTime_t` 的最大值。"
#: ../../c-api/time.rst:42
msgid "Clock Functions"
-msgstr ""
+msgstr "時鐘函式"
#: ../../c-api/time.rst:44
msgid ""
@@ -72,12 +79,14 @@ msgid ""
"to the value of a particular clock. Details of each clock are given in the "
"documentation of the corresponding Python function."
msgstr ""
+"以下的函式接受一個指向 :c:expr:`PyTime_t` 的指標,並將其設定為特定時鐘的值。"
+"每個時鐘的詳細資訊紀錄在相對應的 Python 函式說明文件中。"
#: ../../c-api/time.rst:49
msgid ""
"The functions return ``0`` on success, or ``-1`` (with an exception set) on "
"failure."
-msgstr ""
+msgstr "函式成功時會回傳 ``0`` 或在失敗時回傳 ``-1``\\ (並設定一個例外)。"
#: ../../c-api/time.rst:52
msgid ""
@@ -86,44 +95,51 @@ msgid ""
"range. (On current systems, integer overflows are likely caused by "
"misconfigured system time.)"
msgstr ""
+"在整數溢位時,它們會設定 :c:data:`PyExc_OverflowError` 例外,並將 "
+"``*result`` 設定為夾在 ``[PyTime_MIN; PyTime_MAX]`` 範圍內的值。(在目前的系"
+"統上,整數溢位很可能是由於錯誤設定的系統時間所造成。)"
#: ../../c-api/time.rst:58
msgid ""
"As any other C API (unless otherwise specified), the functions must be "
"called with the :term:`GIL` held."
msgstr ""
+"如同任何其他 C API(除非另有指定),必須在持有 :term:`GIL` 的情況下呼叫函式。"
#: ../../c-api/time.rst:63
msgid ""
"Read the monotonic clock. See :func:`time.monotonic` for important details "
"on this clock."
-msgstr ""
+msgstr "讀取單調時鐘。請參閱 :func:`time.monotonic` 取得此時鐘的重要詳細資訊。"
#: ../../c-api/time.rst:68
msgid ""
"Read the performance counter. See :func:`time.perf_counter` for important "
"details on this clock."
msgstr ""
+"讀取效能計數器。請參閱 :func:`time.perf_counter` 以取得此時鐘的重要詳細資訊。"
#: ../../c-api/time.rst:73
msgid ""
"Read the “wall clock” time. See :func:`time.time` for details important on "
"this clock."
msgstr ""
+"讀取「牆上時鐘 (wall clock)」的時間。請參閱 :func:`time.time` 以取得詳細資"
+"訊。"
#: ../../c-api/time.rst:78
msgid "Raw Clock Functions"
-msgstr ""
+msgstr "原始時鐘函式"
#: ../../c-api/time.rst:80
msgid ""
"Similar to clock functions, but don't set an exception on error and don't "
"require the caller to hold the GIL."
-msgstr ""
+msgstr "類似於時鐘函式,但不會在出錯時設定例外,也不需要讓呼叫者持有 GIL。"
#: ../../c-api/time.rst:83
msgid "On success, the functions return ``0``."
-msgstr ""
+msgstr "成功時函式會回傳 ``0``。"
#: ../../c-api/time.rst:85
msgid ""
@@ -132,35 +148,42 @@ msgid ""
"call the regular (non-``Raw``) function. Note that the regular function may "
"succeed after the ``Raw`` one failed."
msgstr ""
+"失敗時,它們會將 ``*result`` 設為 ``0`` 並回傳 ``-1``, 而\\ *不*\\ 設定例外。"
+"要取得錯誤原因,請取得 GIL 並呼叫常規(非 ``Raw``)函式。請注意,常規函式可能"
+"會在 ``Raw`` 的函式失敗後成功。"
#: ../../c-api/time.rst:92
msgid ""
"Similar to :c:func:`PyTime_Monotonic`, but don't set an exception on error "
"and don't require holding the GIL."
msgstr ""
+"類似於 :c:func:`PyTime_Monotonic`,但不會在出錯時設定例外,也不需要持有 GIL。"
#: ../../c-api/time.rst:97
msgid ""
"Similar to :c:func:`PyTime_PerfCounter`, but don't set an exception on error "
"and don't require holding the GIL."
msgstr ""
+"類似於 :c:func:`PyTime_PerfCounter`,但不會在出錯時設定例外,也不需要持有 "
+"GIL。"
#: ../../c-api/time.rst:102
msgid ""
"Similar to :c:func:`PyTime_Time`, but don't set an exception on error and "
"don't require holding the GIL."
msgstr ""
+"類似於 :c:func:`PyTime_Time`,但不會在出錯時設定例外,也不需要持有 GIL。"
#: ../../c-api/time.rst:107
msgid "Conversion functions"
-msgstr ""
+msgstr "轉換函式"
#: ../../c-api/time.rst:111
msgid "Convert a timestamp to a number of seconds as a C :c:expr:`double`."
-msgstr ""
+msgstr "將時間戳記轉換為 C :c:expr:`double` 的秒數。"
#: ../../c-api/time.rst:113
msgid ""
"The function cannot fail, but note that :c:expr:`double` has limited "
"accuracy for large values."
-msgstr ""
+msgstr "此函式不會失敗,但請注意 :c:expr:`double` 對於大數值的精確度有限。"
diff --git a/c-api/tuple.po b/c-api/tuple.po
index 0392e13819..d70d49e967 100644
--- a/c-api/tuple.po
+++ b/c-api/tuple.po
@@ -72,16 +72,16 @@ msgstr ""
#: ../../c-api/tuple.rst:61
msgid ""
"Return the object at position *pos* in the tuple pointed to by *p*. If "
-"*pos* is negative or out of bounds, return ``NULL`` and set an :exc:"
-"`IndexError` exception."
+"*pos* is negative or out of bounds, return ``NULL`` and set "
+"an :exc:`IndexError` exception."
msgstr ""
#: ../../c-api/tuple.rst:64
msgid ""
"The returned reference is borrowed from the tuple *p* (that is: it is only "
"valid as long as you hold a reference to *p*). To get a :term:`strong "
-"reference`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) ` or :c:"
-"func:`PySequence_GetItem`."
+"reference`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) ` "
+"or :c:func:`PySequence_GetItem`."
msgstr ""
#: ../../c-api/tuple.rst:73
@@ -122,15 +122,17 @@ msgstr ""
#: ../../c-api/tuple.rst:102 ../../c-api/tuple.rst:218
#: ../../c-api/tuple.rst:236
msgid ""
-"Bounds checking is performed as an assertion if Python is built in :ref:"
-"`debug mode ` or :option:`with assertions <--with-assertions>`."
+"Bounds checking is performed as an assertion if Python is built "
+"in :ref:`debug mode ` or :option:`with assertions <--with-"
+"assertions>`."
msgstr ""
#: ../../c-api/tuple.rst:107
msgid ""
-"This function \"steals\" a reference to *o*, and, unlike :c:func:"
-"`PyTuple_SetItem`, does *not* discard a reference to any item that is being "
-"replaced; any reference in the tuple at position *pos* will be leaked."
+"This function \"steals\" a reference to *o*, and, "
+"unlike :c:func:`PyTuple_SetItem`, does *not* discard a reference to any item "
+"that is being replaced; any reference in the tuple at position *pos* will be "
+"leaked."
msgstr ""
#: ../../c-api/tuple.rst:115
@@ -144,8 +146,8 @@ msgid ""
"Client code should never assume that the resulting value of ``*p`` will be "
"the same as before calling this function. If the object referenced by ``*p`` "
"is replaced, the original ``*p`` is destroyed. On failure, returns ``-1`` "
-"and sets ``*p`` to ``NULL``, and raises :exc:`MemoryError` or :exc:"
-"`SystemError`."
+"and sets ``*p`` to ``NULL``, and raises :exc:`MemoryError` "
+"or :exc:`SystemError`."
msgstr ""
#: ../../c-api/tuple.rst:130
@@ -154,22 +156,22 @@ msgstr ""
#: ../../c-api/tuple.rst:132
msgid ""
-"Struct sequence objects are the C equivalent of :func:`~collections."
-"namedtuple` objects, i.e. a sequence whose items can also be accessed "
-"through attributes. To create a struct sequence, you first have to create a "
-"specific struct sequence type."
+"Struct sequence objects are the C equivalent "
+"of :func:`~collections.namedtuple` objects, i.e. a sequence whose items can "
+"also be accessed through attributes. To create a struct sequence, you first "
+"have to create a specific struct sequence type."
msgstr ""
#: ../../c-api/tuple.rst:139
msgid ""
"Create a new struct sequence type from the data in *desc*, described below. "
-"Instances of the resulting type can be created with :c:func:"
-"`PyStructSequence_New`."
+"Instances of the resulting type can be created "
+"with :c:func:`PyStructSequence_New`."
msgstr ""
#: ../../c-api/tuple.rst:142 ../../c-api/tuple.rst:211
msgid "Return ``NULL`` with an exception set on failure."
-msgstr ""
+msgstr "失敗時回傳 ``NULL`` 並設定例外。"
#: ../../c-api/tuple.rst:147
msgid "Initializes a struct sequence type *type* from *desc* in place."
@@ -206,16 +208,16 @@ msgstr ""
#: ../../c-api/tuple.rst:182
msgid ""
"Describes a field of a struct sequence. As a struct sequence is modeled as a "
-"tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:"
-"member:`~PyStructSequence_Desc.fields` array of the :c:type:"
-"`PyStructSequence_Desc` determines which field of the struct sequence is "
-"described."
+"tuple, all fields are typed as :c:expr:`PyObject*`. The index in "
+"the :c:member:`~PyStructSequence_Desc.fields` array of "
+"the :c:type:`PyStructSequence_Desc` determines which field of the struct "
+"sequence is described."
msgstr ""
#: ../../c-api/tuple.rst:190
msgid ""
-"Name for the field or ``NULL`` to end the list of named fields, set to :c:"
-"data:`PyStructSequence_UnnamedField` to leave unnamed."
+"Name for the field or ``NULL`` to end the list of named fields, set "
+"to :c:data:`PyStructSequence_UnnamedField` to leave unnamed."
msgstr ""
#: ../../c-api/tuple.rst:195
@@ -232,8 +234,8 @@ msgstr ""
#: ../../c-api/tuple.rst:208
msgid ""
-"Creates an instance of *type*, which must have been created with :c:func:"
-"`PyStructSequence_NewType`."
+"Creates an instance of *type*, which must have been created "
+"with :c:func:`PyStructSequence_NewType`."
msgstr ""
#: ../../c-api/tuple.rst:216
diff --git a/c-api/type.po b/c-api/type.po
index 570d06ce19..0ff3fc423c 100644
--- a/c-api/type.po
+++ b/c-api/type.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-12-01 15:01+0000\n"
+"POT-Creation-Date: 2025-04-03 00:14+0000\n"
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
"Last-Translator: Liang-Bo Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -98,21 +98,27 @@ msgid ""
"exception."
msgstr ""
-#: ../../c-api/type.rst:90
+#: ../../c-api/type.rst:85
+msgid ""
+"In free-threaded builds, :c:func:`PyType_AddWatcher` is not thread-safe, so "
+"it must be called at start up (before spawning the first thread)."
+msgstr ""
+
+#: ../../c-api/type.rst:93
msgid ""
"Clear watcher identified by *watcher_id* (previously returned from :c:func:"
"`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g. if "
"*watcher_id* was never registered.)"
msgstr ""
-#: ../../c-api/type.rst:94
+#: ../../c-api/type.rst:97
msgid ""
"An extension should never call ``PyType_ClearWatcher`` with a *watcher_id* "
"that was not returned to it by a previous call to :c:func:"
"`PyType_AddWatcher`."
msgstr ""
-#: ../../c-api/type.rst:103
+#: ../../c-api/type.rst:106
msgid ""
"Mark *type* as watched. The callback granted *watcher_id* by :c:func:"
"`PyType_AddWatcher` will be called whenever :c:func:`PyType_Modified` "
@@ -122,61 +128,61 @@ msgid ""
"detail and subject to change.)"
msgstr ""
-#: ../../c-api/type.rst:110
+#: ../../c-api/type.rst:113
msgid ""
"An extension should never call ``PyType_Watch`` with a *watcher_id* that was "
"not returned to it by a previous call to :c:func:`PyType_AddWatcher`."
msgstr ""
-#: ../../c-api/type.rst:118
+#: ../../c-api/type.rst:121
msgid "Type of a type-watcher callback function."
msgstr ""
-#: ../../c-api/type.rst:120
+#: ../../c-api/type.rst:123
msgid ""
"The callback must not modify *type* or cause :c:func:`PyType_Modified` to be "
"called on *type* or any type in its MRO; violating this rule could cause "
"infinite recursion."
msgstr ""
-#: ../../c-api/type.rst:129
+#: ../../c-api/type.rst:132
msgid ""
"Return non-zero if the type object *o* sets the feature *feature*. Type "
"features are denoted by single bit flags."
msgstr ""
-#: ../../c-api/type.rst:135
+#: ../../c-api/type.rst:138
msgid ""
"Return true if the type object includes support for the cycle detector; this "
"tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`."
msgstr ""
-#: ../../c-api/type.rst:141
+#: ../../c-api/type.rst:144
msgid "Return true if *a* is a subtype of *b*."
msgstr ""
-#: ../../c-api/type.rst:143
+#: ../../c-api/type.rst:146
msgid ""
"This function only checks for actual subtypes, which means that :meth:`~type."
"__subclasscheck__` is not called on *b*. Call :c:func:`PyObject_IsSubclass` "
"to do the same check that :func:`issubclass` would do."
msgstr ""
-#: ../../c-api/type.rst:151
+#: ../../c-api/type.rst:154
msgid ""
"Generic handler for the :c:member:`~PyTypeObject.tp_alloc` slot of a type "
"object. Use Python's default memory allocation mechanism to allocate a new "
"instance and initialize all its contents to ``NULL``."
msgstr ""
-#: ../../c-api/type.rst:157
+#: ../../c-api/type.rst:160
msgid ""
"Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type "
"object. Create a new instance using the type's :c:member:`~PyTypeObject."
"tp_alloc` slot."
msgstr ""
-#: ../../c-api/type.rst:162
+#: ../../c-api/type.rst:165
msgid ""
"Finalize a type object. This should be called on all type objects to finish "
"their initialization. This function is responsible for adding inherited "
@@ -184,7 +190,7 @@ msgid ""
"and sets an exception on error."
msgstr ""
-#: ../../c-api/type.rst:168
+#: ../../c-api/type.rst:171
msgid ""
"If some of the base classes implements the GC protocol and the provided type "
"does not include the :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC "
@@ -195,32 +201,32 @@ msgid ""
"handle."
msgstr ""
-#: ../../c-api/type.rst:178
+#: ../../c-api/type.rst:181
msgid ""
"Return the type's name. Equivalent to getting the type's :attr:`~type."
"__name__` attribute."
msgstr ""
-#: ../../c-api/type.rst:185
+#: ../../c-api/type.rst:188
msgid ""
"Return the type's qualified name. Equivalent to getting the type's :attr:"
"`~type.__qualname__` attribute."
msgstr ""
-#: ../../c-api/type.rst:192
+#: ../../c-api/type.rst:195
msgid ""
"Return the type's fully qualified name. Equivalent to ``f\"{type.__module__}."
"{type.__qualname__}\"``, or :attr:`type.__qualname__` if :attr:`type."
"__module__` is not a string or is equal to ``\"builtins\"``."
msgstr ""
-#: ../../c-api/type.rst:200
+#: ../../c-api/type.rst:203
msgid ""
"Return the type's module name. Equivalent to getting the :attr:`type."
"__module__` attribute."
msgstr ""
-#: ../../c-api/type.rst:207
+#: ../../c-api/type.rst:210
msgid ""
"Return the function pointer stored in the given slot. If the result is "
"``NULL``, this indicates that either the slot is ``NULL``, or that the "
@@ -228,30 +234,30 @@ msgid ""
"result pointer into the appropriate function type."
msgstr ""
-#: ../../c-api/type.rst:213
+#: ../../c-api/type.rst:216
msgid ""
"See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument."
msgstr ""
-#: ../../c-api/type.rst:217
+#: ../../c-api/type.rst:220
msgid ""
":c:func:`PyType_GetSlot` can now accept all types. Previously, it was "
"limited to :ref:`heap types `."
msgstr ""
-#: ../../c-api/type.rst:223
+#: ../../c-api/type.rst:226
msgid ""
"Return the module object associated with the given type when the type was "
"created using :c:func:`PyType_FromModuleAndSpec`."
msgstr ""
-#: ../../c-api/type.rst:226 ../../c-api/type.rst:246
+#: ../../c-api/type.rst:229 ../../c-api/type.rst:249
msgid ""
"If no module is associated with the given type, sets :py:class:`TypeError` "
"and returns ``NULL``."
msgstr ""
-#: ../../c-api/type.rst:229
+#: ../../c-api/type.rst:232
msgid ""
"This function is usually used to get the module in which a method is "
"defined. Note that in such a method, ``PyType_GetModule(Py_TYPE(self))`` may "
@@ -262,31 +268,31 @@ msgid ""
"type:`!PyCMethod` cannot be used."
msgstr ""
-#: ../../c-api/type.rst:242
+#: ../../c-api/type.rst:245
msgid ""
"Return the state of the module object associated with the given type. This "
"is a shortcut for calling :c:func:`PyModule_GetState()` on the result of :c:"
"func:`PyType_GetModule`."
msgstr ""
-#: ../../c-api/type.rst:249
+#: ../../c-api/type.rst:252
msgid ""
"If the *type* has an associated module but its state is ``NULL``, returns "
"``NULL`` without setting an exception."
msgstr ""
-#: ../../c-api/type.rst:256
+#: ../../c-api/type.rst:259
msgid ""
"Find the first superclass whose module was created from the given :c:type:"
"`PyModuleDef` *def*, and return that module."
msgstr ""
-#: ../../c-api/type.rst:259
+#: ../../c-api/type.rst:262
msgid ""
"If no module is found, raises a :py:class:`TypeError` and returns ``NULL``."
msgstr ""
-#: ../../c-api/type.rst:261
+#: ../../c-api/type.rst:264
msgid ""
"This function is intended to be used together with :c:func:"
"`PyModule_GetState()` to get module state from slot methods (such as :c:"
@@ -295,40 +301,40 @@ msgid ""
"type:`PyCMethod` calling convention."
msgstr ""
-#: ../../c-api/type.rst:271
+#: ../../c-api/type.rst:274
msgid "Attempt to assign a version tag to the given type."
msgstr ""
-#: ../../c-api/type.rst:273
+#: ../../c-api/type.rst:276
msgid ""
"Returns 1 if the type already had a valid version tag or a new one was "
"assigned, or 0 if a new tag could not be assigned."
msgstr ""
-#: ../../c-api/type.rst:280
+#: ../../c-api/type.rst:283
msgid "Creating Heap-Allocated Types"
msgstr ""
-#: ../../c-api/type.rst:282
+#: ../../c-api/type.rst:285
msgid ""
"The following functions and structs are used to create :ref:`heap types "
"`."
msgstr ""
-#: ../../c-api/type.rst:287
+#: ../../c-api/type.rst:290
msgid ""
"Create and return a :ref:`heap type ` from the *spec* (see :c:"
"macro:`Py_TPFLAGS_HEAPTYPE`)."
msgstr ""
-#: ../../c-api/type.rst:290
+#: ../../c-api/type.rst:293
msgid ""
"The metaclass *metaclass* is used to construct the resulting type object. "
"When *metaclass* is ``NULL``, the metaclass is derived from *bases* (or "
"*Py_tp_base[s]* slots if *bases* is ``NULL``, see below)."
msgstr ""
-#: ../../c-api/type.rst:294
+#: ../../c-api/type.rst:297
msgid ""
"Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not "
"supported, except if ``tp_new`` is ``NULL``. (For backwards compatibility, "
@@ -337,7 +343,7 @@ msgid ""
"deprecated and in Python 3.14+ such metaclasses will not be supported.)"
msgstr ""
-#: ../../c-api/type.rst:301
+#: ../../c-api/type.rst:304
msgid ""
"The *bases* argument can be used to specify base classes; it can either be "
"only one class or a tuple of classes. If *bases* is ``NULL``, the "
@@ -346,7 +352,7 @@ msgid ""
"derives from :class:`object`."
msgstr ""
-#: ../../c-api/type.rst:307
+#: ../../c-api/type.rst:310
msgid ""
"The *module* argument can be used to record the module in which the new "
"class is defined. It must be a module object or ``NULL``. If not ``NULL``, "
@@ -355,11 +361,11 @@ msgid ""
"subclasses; it must be specified for each class individually."
msgstr ""
-#: ../../c-api/type.rst:314
+#: ../../c-api/type.rst:317
msgid "This function calls :c:func:`PyType_Ready` on the new type."
msgstr ""
-#: ../../c-api/type.rst:316
+#: ../../c-api/type.rst:319
msgid ""
"Note that this function does *not* fully match the behavior of calling :py:"
"class:`type() ` or using the :keyword:`class` statement. With user-"
@@ -368,41 +374,41 @@ msgid ""
"Specifically:"
msgstr ""
-#: ../../c-api/type.rst:323
+#: ../../c-api/type.rst:326
msgid ""
":py:meth:`~object.__new__` is not called on the new class (and it must be "
"set to ``type.__new__``)."
msgstr ""
-#: ../../c-api/type.rst:325
+#: ../../c-api/type.rst:328
msgid ":py:meth:`~object.__init__` is not called on the new class."
msgstr ""
-#: ../../c-api/type.rst:326
+#: ../../c-api/type.rst:329
msgid ":py:meth:`~object.__init_subclass__` is not called on any bases."
msgstr ""
-#: ../../c-api/type.rst:327
+#: ../../c-api/type.rst:330
msgid ":py:meth:`~object.__set_name__` is not called on new descriptors."
msgstr ""
-#: ../../c-api/type.rst:333
+#: ../../c-api/type.rst:336
msgid "Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases)``."
msgstr "等價於 ``PyType_FromMetaclass(NULL, module, spec, bases)``。"
-#: ../../c-api/type.rst:339
+#: ../../c-api/type.rst:342
msgid ""
"The function now accepts a single class as the *bases* argument and ``NULL`` "
"as the ``tp_doc`` slot."
msgstr ""
-#: ../../c-api/type.rst:344 ../../c-api/type.rst:361
+#: ../../c-api/type.rst:347 ../../c-api/type.rst:364
msgid ""
"The function now finds and uses a metaclass corresponding to the provided "
"base classes. Previously, only :class:`type` instances were returned."
msgstr ""
-#: ../../c-api/type.rst:347 ../../c-api/type.rst:364 ../../c-api/type.rst:380
+#: ../../c-api/type.rst:350 ../../c-api/type.rst:367 ../../c-api/type.rst:383
msgid ""
"The :c:member:`~PyTypeObject.tp_new` of the metaclass is *ignored*. which "
"may result in incomplete initialization. Creating classes whose metaclass "
@@ -410,60 +416,62 @@ msgid ""
"it will be no longer allowed."
msgstr ""
-#: ../../c-api/type.rst:355
+#: ../../c-api/type.rst:358
msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases)``."
msgstr "等價於 ``PyType_FromMetaclass(NULL, NULL, spec, bases)``。"
-#: ../../c-api/type.rst:372
+#: ../../c-api/type.rst:375
msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``."
msgstr "等價於 ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``。"
-#: ../../c-api/type.rst:376
+#: ../../c-api/type.rst:379
msgid ""
"The function now finds and uses a metaclass corresponding to the base "
"classes provided in *Py_tp_base[s]* slots. Previously, only :class:`type` "
"instances were returned."
msgstr ""
-#: ../../c-api/type.rst:397
+#: ../../c-api/type.rst:400
msgid "Structure defining a type's behavior."
msgstr ""
-#: ../../c-api/type.rst:401
+#: ../../c-api/type.rst:404
msgid "Name of the type, used to set :c:member:`PyTypeObject.tp_name`."
msgstr ""
-#: ../../c-api/type.rst:405
+#: ../../c-api/type.rst:408
msgid ""
"If positive, specifies the size of the instance in bytes. It is used to set :"
"c:member:`PyTypeObject.tp_basicsize`."
msgstr ""
-#: ../../c-api/type.rst:408
+#: ../../c-api/type.rst:411
msgid ""
"If zero, specifies that :c:member:`~PyTypeObject.tp_basicsize` should be "
"inherited."
msgstr ""
-#: ../../c-api/type.rst:411
+#: ../../c-api/type.rst:414
msgid ""
"If negative, the absolute value specifies how much space instances of the "
"class need *in addition* to the superclass. Use :c:func:"
"`PyObject_GetTypeData` to get a pointer to subclass-specific memory reserved "
-"this way."
+"this way. For negative :c:member:`!basicsize`, Python will insert padding "
+"when needed to meet :c:member:`~PyTypeObject.tp_basicsize`'s alignment "
+"requirements."
msgstr ""
-#: ../../c-api/type.rst:418
+#: ../../c-api/type.rst:424
msgid "Previously, this field could not be negative."
msgstr ""
-#: ../../c-api/type.rst:422
+#: ../../c-api/type.rst:428
msgid ""
"Size of one element of a variable-size type, in bytes. Used to set :c:member:"
"`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for caveats."
msgstr ""
-#: ../../c-api/type.rst:426
+#: ../../c-api/type.rst:432
msgid ""
"If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending "
"arbitrary variable-sized classes is dangerous, since some types use a fixed "
@@ -472,58 +480,58 @@ msgid ""
"only possible in the following situations:"
msgstr ""
-#: ../../c-api/type.rst:433
+#: ../../c-api/type.rst:439
msgid ""
"The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize`)."
msgstr ""
-#: ../../c-api/type.rst:435
+#: ../../c-api/type.rst:441
msgid ""
"The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that "
"the memory layout of the base class is known."
msgstr ""
-#: ../../c-api/type.rst:437
+#: ../../c-api/type.rst:443
msgid ""
"The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the "
"subclass does not access the instance's memory directly."
msgstr ""
-#: ../../c-api/type.rst:440
+#: ../../c-api/type.rst:446
msgid "With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag."
msgstr ""
-#: ../../c-api/type.rst:444
+#: ../../c-api/type.rst:450
msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`."
msgstr ""
-#: ../../c-api/type.rst:446
+#: ../../c-api/type.rst:452
msgid ""
"If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:"
"`PyType_FromSpecWithBases` sets it automatically."
msgstr ""
-#: ../../c-api/type.rst:451
+#: ../../c-api/type.rst:457
msgid ""
"Array of :c:type:`PyType_Slot` structures. Terminated by the special slot "
"value ``{0, NULL}``."
msgstr ""
-#: ../../c-api/type.rst:454
+#: ../../c-api/type.rst:460
msgid "Each slot ID should be specified at most once."
msgstr ""
-#: ../../c-api/type.rst:464
+#: ../../c-api/type.rst:470
msgid ""
"Structure defining optional functionality of a type, containing a slot ID "
"and a value pointer."
msgstr ""
-#: ../../c-api/type.rst:469
+#: ../../c-api/type.rst:475
msgid "A slot ID."
msgstr ""
-#: ../../c-api/type.rst:471
+#: ../../c-api/type.rst:477
msgid ""
"Slot IDs are named like the field names of the structures :c:type:"
"`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:"
@@ -531,30 +539,30 @@ msgid ""
"prefix. For example, use:"
msgstr ""
-#: ../../c-api/type.rst:477
+#: ../../c-api/type.rst:483
msgid "``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`"
msgstr ""
-#: ../../c-api/type.rst:478
+#: ../../c-api/type.rst:484
msgid "``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`"
msgstr ""
-#: ../../c-api/type.rst:479
+#: ../../c-api/type.rst:485
msgid "``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`"
msgstr ""
-#: ../../c-api/type.rst:481
+#: ../../c-api/type.rst:487
msgid ""
"The following “offset” fields cannot be set using :c:type:`PyType_Slot`:"
msgstr ""
-#: ../../c-api/type.rst:483
+#: ../../c-api/type.rst:489
msgid ""
":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:"
"`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)"
msgstr ""
-#: ../../c-api/type.rst:485
+#: ../../c-api/type.rst:491
msgid ""
":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:"
"`Py_TPFLAGS_MANAGED_DICT` instead if possible)"
@@ -562,7 +570,7 @@ msgstr ""
":c:member:`~PyTypeObject.tp_dictoffset`\\ (如果可能,請改用 :c:macro:"
"`Py_TPFLAGS_MANAGED_DICT`)"
-#: ../../c-api/type.rst:487
+#: ../../c-api/type.rst:493
msgid ""
":c:member:`~PyTypeObject.tp_vectorcall_offset` (use "
"``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)"
@@ -570,7 +578,7 @@ msgstr ""
":c:member:`~PyTypeObject.tp_vectorcall_offset`\\ (請用 :ref:`PyMemberDef "
"` 中的 ``\"__vectorcalloffset__\"``)"
-#: ../../c-api/type.rst:491
+#: ../../c-api/type.rst:497
msgid ""
"If it is not possible to switch to a ``MANAGED`` flag (for example, for "
"vectorcall or to support Python older than 3.12), specify the offset in :c:"
@@ -578,48 +586,48 @@ msgid ""
"documentation ` for details."
msgstr ""
-#: ../../c-api/type.rst:497
+#: ../../c-api/type.rst:503
msgid "The following fields cannot be set at all when creating a heap type:"
msgstr ""
-#: ../../c-api/type.rst:499
+#: ../../c-api/type.rst:505
msgid ""
":c:member:`~PyTypeObject.tp_vectorcall` (use :c:member:`~PyTypeObject."
"tp_new` and/or :c:member:`~PyTypeObject.tp_init`)"
msgstr ""
-#: ../../c-api/type.rst:503
+#: ../../c-api/type.rst:509
msgid ""
"Internal fields: :c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject."
"tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject."
"tp_subclasses`, and :c:member:`~PyTypeObject.tp_weaklist`."
msgstr ""
-#: ../../c-api/type.rst:510
+#: ../../c-api/type.rst:516
msgid ""
"Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on "
"some platforms. To avoid issues, use the *bases* argument of :c:func:"
"`PyType_FromSpecWithBases` instead."
msgstr ""
-#: ../../c-api/type.rst:515
+#: ../../c-api/type.rst:521
msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API."
msgstr ""
-#: ../../c-api/type.rst:518
+#: ../../c-api/type.rst:524
msgid ""
":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs."
"bf_releasebuffer` are now available under the :ref:`limited API `."
msgstr ""
-#: ../../c-api/type.rst:525
+#: ../../c-api/type.rst:531
msgid ""
"The desired value of the slot. In most cases, this is a pointer to a "
"function."
msgstr ""
-#: ../../c-api/type.rst:528
+#: ../../c-api/type.rst:534
msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``."
msgstr ""
diff --git a/c-api/typeobj.po b/c-api/typeobj.po
index 2b7e6341f3..3ffb4c871b 100644
--- a/c-api/typeobj.po
+++ b/c-api/typeobj.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-10-22 00:13+0000\n"
+"POT-Creation-Date: 2025-04-14 00:15+0000\n"
"PO-Revision-Date: 2018-05-23 14:33+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -18,8 +18,8 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../c-api/typeobj.rst:6
-msgid "Type Objects"
-msgstr "型別物件"
+msgid "Type Object Structures"
+msgstr "型別物件結構"
#: ../../c-api/typeobj.rst:8
msgid ""
@@ -45,8 +45,8 @@ msgstr ""
#: ../../c-api/typeobj.rst:23
msgid ""
"In addition to the following quick reference, the :ref:`typedef-examples` "
-"section provides at-a-glance insight into the meaning and use of :c:type:"
-"`PyTypeObject`."
+"section provides at-a-glance insight into the meaning and use "
+"of :c:type:`PyTypeObject`."
msgstr ""
#: ../../c-api/typeobj.rst:29
@@ -1171,9 +1171,9 @@ msgstr ""
#: ../../c-api/typeobj.rst:475
msgid ""
-"The structure definition for :c:type:`PyTypeObject` can be found in :file:"
-"`Include/object.h`. For convenience of reference, this repeats the "
-"definition found there:"
+"The structure definition for :c:type:`PyTypeObject` can be found "
+"in :file:`Include/cpython/object.h`. For convenience of reference, this "
+"repeats the definition found there:"
msgstr ""
#: ../../c-api/typeobj.rst:481
@@ -1272,11 +1272,12 @@ msgstr ""
#: ../../c-api/typeobj.rst:487
msgid ""
-"The type object structure extends the :c:type:`PyVarObject` structure. The :"
-"c:member:`~PyVarObject.ob_size` field is used for dynamic types (created by :"
-"c:func:`!type_new`, usually called from a class statement). Note that :c:"
-"data:`PyType_Type` (the metatype) initializes :c:member:`~PyTypeObject."
-"tp_itemsize`, which means that its instances (i.e. type objects) *must* have "
+"The type object structure extends the :c:type:`PyVarObject` structure. "
+"The :c:member:`~PyVarObject.ob_size` field is used for dynamic types "
+"(created by :c:func:`!type_new`, usually called from a class statement). "
+"Note that :c:data:`PyType_Type` (the metatype) "
+"initializes :c:member:`~PyTypeObject.tp_itemsize`, which means that its "
+"instances (i.e. type objects) *must* have "
"the :c:member:`~PyVarObject.ob_size` field."
msgstr ""
@@ -1284,49 +1285,49 @@ msgstr ""
msgid ""
"This is the type object's reference count, initialized to ``1`` by the "
"``PyObject_HEAD_INIT`` macro. Note that for :ref:`statically allocated type "
-"objects `, the type's instances (objects whose :c:member:"
-"`~PyObject.ob_type` points back to the type) do *not* count as references. "
-"But for :ref:`dynamically allocated type objects `, the "
-"instances *do* count as references."
+"objects `, the type's instances (objects "
+"whose :c:member:`~PyObject.ob_type` points back to the type) do *not* count "
+"as references. But for :ref:`dynamically allocated type objects `, the instances *do* count as references."
msgstr ""
#: ../../c-api/typeobj.rst:503 ../../c-api/typeobj.rst:526
-#: ../../c-api/typeobj.rst:540 ../../c-api/typeobj.rst:584
-#: ../../c-api/typeobj.rst:627 ../../c-api/typeobj.rst:699
-#: ../../c-api/typeobj.rst:740 ../../c-api/typeobj.rst:757
-#: ../../c-api/typeobj.rst:774 ../../c-api/typeobj.rst:792
-#: ../../c-api/typeobj.rst:816 ../../c-api/typeobj.rst:833
-#: ../../c-api/typeobj.rst:845 ../../c-api/typeobj.rst:857
-#: ../../c-api/typeobj.rst:890 ../../c-api/typeobj.rst:912
-#: ../../c-api/typeobj.rst:932 ../../c-api/typeobj.rst:953
-#: ../../c-api/typeobj.rst:979 ../../c-api/typeobj.rst:998
-#: ../../c-api/typeobj.rst:1014 ../../c-api/typeobj.rst:1053
-#: ../../c-api/typeobj.rst:1064 ../../c-api/typeobj.rst:1074
-#: ../../c-api/typeobj.rst:1084 ../../c-api/typeobj.rst:1098
-#: ../../c-api/typeobj.rst:1116 ../../c-api/typeobj.rst:1139
-#: ../../c-api/typeobj.rst:1157 ../../c-api/typeobj.rst:1170
-#: ../../c-api/typeobj.rst:1192 ../../c-api/typeobj.rst:1236
-#: ../../c-api/typeobj.rst:1257 ../../c-api/typeobj.rst:1276
-#: ../../c-api/typeobj.rst:1306 ../../c-api/typeobj.rst:1328
-#: ../../c-api/typeobj.rst:1354 ../../c-api/typeobj.rst:1439
-#: ../../c-api/typeobj.rst:1513 ../../c-api/typeobj.rst:1574
-#: ../../c-api/typeobj.rst:1610 ../../c-api/typeobj.rst:1635
-#: ../../c-api/typeobj.rst:1658 ../../c-api/typeobj.rst:1671
-#: ../../c-api/typeobj.rst:1686 ../../c-api/typeobj.rst:1700
-#: ../../c-api/typeobj.rst:1730 ../../c-api/typeobj.rst:1762
-#: ../../c-api/typeobj.rst:1788 ../../c-api/typeobj.rst:1806
-#: ../../c-api/typeobj.rst:1835 ../../c-api/typeobj.rst:1879
-#: ../../c-api/typeobj.rst:1896 ../../c-api/typeobj.rst:1937
-#: ../../c-api/typeobj.rst:1959 ../../c-api/typeobj.rst:1991
-#: ../../c-api/typeobj.rst:2019 ../../c-api/typeobj.rst:2032
-#: ../../c-api/typeobj.rst:2042 ../../c-api/typeobj.rst:2059
-#: ../../c-api/typeobj.rst:2076 ../../c-api/typeobj.rst:2090
-#: ../../c-api/typeobj.rst:2125 ../../c-api/typeobj.rst:2148
+#: ../../c-api/typeobj.rst:543 ../../c-api/typeobj.rst:587
+#: ../../c-api/typeobj.rst:665 ../../c-api/typeobj.rst:741
+#: ../../c-api/typeobj.rst:782 ../../c-api/typeobj.rst:799
+#: ../../c-api/typeobj.rst:816 ../../c-api/typeobj.rst:834
+#: ../../c-api/typeobj.rst:858 ../../c-api/typeobj.rst:875
+#: ../../c-api/typeobj.rst:887 ../../c-api/typeobj.rst:899
+#: ../../c-api/typeobj.rst:932 ../../c-api/typeobj.rst:954
+#: ../../c-api/typeobj.rst:974 ../../c-api/typeobj.rst:995
+#: ../../c-api/typeobj.rst:1021 ../../c-api/typeobj.rst:1040
+#: ../../c-api/typeobj.rst:1056 ../../c-api/typeobj.rst:1095
+#: ../../c-api/typeobj.rst:1106 ../../c-api/typeobj.rst:1116
+#: ../../c-api/typeobj.rst:1126 ../../c-api/typeobj.rst:1140
+#: ../../c-api/typeobj.rst:1158 ../../c-api/typeobj.rst:1181
+#: ../../c-api/typeobj.rst:1199 ../../c-api/typeobj.rst:1212
+#: ../../c-api/typeobj.rst:1234 ../../c-api/typeobj.rst:1278
+#: ../../c-api/typeobj.rst:1299 ../../c-api/typeobj.rst:1318
+#: ../../c-api/typeobj.rst:1348 ../../c-api/typeobj.rst:1370
+#: ../../c-api/typeobj.rst:1396 ../../c-api/typeobj.rst:1481
+#: ../../c-api/typeobj.rst:1555 ../../c-api/typeobj.rst:1616
+#: ../../c-api/typeobj.rst:1652 ../../c-api/typeobj.rst:1677
+#: ../../c-api/typeobj.rst:1700 ../../c-api/typeobj.rst:1713
+#: ../../c-api/typeobj.rst:1728 ../../c-api/typeobj.rst:1742
+#: ../../c-api/typeobj.rst:1772 ../../c-api/typeobj.rst:1804
+#: ../../c-api/typeobj.rst:1830 ../../c-api/typeobj.rst:1848
+#: ../../c-api/typeobj.rst:1877 ../../c-api/typeobj.rst:1921
+#: ../../c-api/typeobj.rst:1938 ../../c-api/typeobj.rst:1979
+#: ../../c-api/typeobj.rst:2001 ../../c-api/typeobj.rst:2033
+#: ../../c-api/typeobj.rst:2061 ../../c-api/typeobj.rst:2074
+#: ../../c-api/typeobj.rst:2084 ../../c-api/typeobj.rst:2101
+#: ../../c-api/typeobj.rst:2118 ../../c-api/typeobj.rst:2132
+#: ../../c-api/typeobj.rst:2165 ../../c-api/typeobj.rst:2188
msgid "**Inheritance:**"
msgstr ""
-#: ../../c-api/typeobj.rst:505 ../../c-api/typeobj.rst:542
-#: ../../c-api/typeobj.rst:586
+#: ../../c-api/typeobj.rst:505 ../../c-api/typeobj.rst:545
+#: ../../c-api/typeobj.rst:589
msgid "This field is not inherited by subtypes."
msgstr ""
@@ -1348,18 +1349,19 @@ msgstr "Foo_Type.ob_type = &PyType_Type;"
#: ../../c-api/typeobj.rst:521
msgid ""
-"This should be done before any instances of the type are created. :c:func:"
-"`PyType_Ready` checks if :c:member:`~PyObject.ob_type` is ``NULL``, and if "
-"so, initializes it to the :c:member:`~PyObject.ob_type` field of the base "
-"class. :c:func:`PyType_Ready` will not change this field if it is non-zero."
+"This should be done before any instances of the type are "
+"created. :c:func:`PyType_Ready` checks if :c:member:`~PyObject.ob_type` is "
+"``NULL``, and if so, initializes it to the :c:member:`~PyObject.ob_type` "
+"field of the base class. :c:func:`PyType_Ready` will not change this field "
+"if it is non-zero."
msgstr ""
-#: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:701
-#: ../../c-api/typeobj.rst:818 ../../c-api/typeobj.rst:914
-#: ../../c-api/typeobj.rst:934 ../../c-api/typeobj.rst:1637
-#: ../../c-api/typeobj.rst:1660 ../../c-api/typeobj.rst:1790
-#: ../../c-api/typeobj.rst:1808 ../../c-api/typeobj.rst:1881
-#: ../../c-api/typeobj.rst:1993 ../../c-api/typeobj.rst:2127
+#: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:743
+#: ../../c-api/typeobj.rst:860 ../../c-api/typeobj.rst:956
+#: ../../c-api/typeobj.rst:976 ../../c-api/typeobj.rst:1679
+#: ../../c-api/typeobj.rst:1702 ../../c-api/typeobj.rst:1832
+#: ../../c-api/typeobj.rst:1850 ../../c-api/typeobj.rst:1923
+#: ../../c-api/typeobj.rst:2035 ../../c-api/typeobj.rst:2167
msgid "This field is inherited by subtypes."
msgstr ""
@@ -1374,38 +1376,45 @@ msgid ""
"types>`, this field has a special internal meaning."
msgstr ""
-#: ../../c-api/typeobj.rst:546
+#: ../../c-api/typeobj.rst:540
+msgid ""
+"This field should be accessed using the :c:func:`Py_SIZE()` "
+"and :c:func:`Py_SET_SIZE()` macros."
+msgstr ""
+
+#: ../../c-api/typeobj.rst:549
msgid "PyTypeObject Slots"
msgstr ""
-#: ../../c-api/typeobj.rst:548
+#: ../../c-api/typeobj.rst:551
msgid ""
"Each slot has a section describing inheritance. If :c:func:`PyType_Ready` "
"may set a value when the field is set to ``NULL`` then there will also be a "
-"\"Default\" section. (Note that many fields set on :c:data:"
-"`PyBaseObject_Type` and :c:data:`PyType_Type` effectively act as defaults.)"
+"\"Default\" section. (Note that many fields set "
+"on :c:data:`PyBaseObject_Type` and :c:data:`PyType_Type` effectively act as "
+"defaults.)"
msgstr ""
-#: ../../c-api/typeobj.rst:555
+#: ../../c-api/typeobj.rst:558
msgid ""
"Pointer to a NUL-terminated string containing the name of the type. For "
"types that are accessible as module globals, the string should be the full "
"module name, followed by a dot, followed by the type name; for built-in "
"types, it should be just the type name. If the module is a submodule of a "
"package, the full package name is part of the full module name. For "
-"example, a type named :class:`!T` defined in module :mod:`!M` in subpackage :"
-"mod:`!Q` in package :mod:`!P` should have the :c:member:`~PyTypeObject."
-"tp_name` initializer ``\"P.Q.M.T\"``."
+"example, a type named :class:`!T` defined in module :mod:`!M` in "
+"subpackage :mod:`!Q` in package :mod:`!P` should have "
+"the :c:member:`~PyTypeObject.tp_name` initializer ``\"P.Q.M.T\"``."
msgstr ""
-#: ../../c-api/typeobj.rst:563
+#: ../../c-api/typeobj.rst:566
msgid ""
"For :ref:`dynamically allocated type objects `, this should just "
"be the type name, and the module name explicitly stored in the type dict as "
"the value for key ``'__module__'``."
msgstr ""
-#: ../../c-api/typeobj.rst:568
+#: ../../c-api/typeobj.rst:571
msgid ""
"For :ref:`statically allocated type objects `, the *tp_name* "
"field should contain a dot. Everything before the last dot is made "
@@ -1413,90 +1422,147 @@ msgid ""
"the last dot is made accessible as the :attr:`~type.__name__` attribute."
msgstr ""
-#: ../../c-api/typeobj.rst:574
+#: ../../c-api/typeobj.rst:577
msgid ""
"If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is "
-"made accessible as the :attr:`~type.__name__` attribute, and the :attr:"
-"`~type.__module__` attribute is undefined (unless explicitly set in the "
-"dictionary, as explained above). This means your type will be impossible to "
-"pickle. Additionally, it will not be listed in module documentations "
-"created with pydoc."
+"made accessible as the :attr:`~type.__name__` attribute, and "
+"the :attr:`~type.__module__` attribute is undefined (unless explicitly set "
+"in the dictionary, as explained above). This means your type will be "
+"impossible to pickle. Additionally, it will not be listed in module "
+"documentations created with pydoc."
msgstr ""
-#: ../../c-api/typeobj.rst:580
+#: ../../c-api/typeobj.rst:583
msgid ""
-"This field must not be ``NULL``. It is the only required field in :c:func:"
-"`PyTypeObject` (other than potentially :c:member:`~PyTypeObject."
-"tp_itemsize`)."
+"This field must not be ``NULL``. It is the only required field "
+"in :c:func:`PyTypeObject` (other than "
+"potentially :c:member:`~PyTypeObject.tp_itemsize`)."
msgstr ""
-#: ../../c-api/typeobj.rst:592
+#: ../../c-api/typeobj.rst:595
msgid ""
"These fields allow calculating the size in bytes of instances of the type."
msgstr ""
-#: ../../c-api/typeobj.rst:594
+#: ../../c-api/typeobj.rst:597
msgid ""
-"There are two kinds of types: types with fixed-length instances have a zero :"
-"c:member:`~PyTypeObject.tp_itemsize` field, types with variable-length "
-"instances have a non-zero :c:member:`~PyTypeObject.tp_itemsize` field. For "
-"a type with fixed-length instances, all instances have the same size, given "
-"in :c:member:`~PyTypeObject.tp_basicsize`."
+"There are two kinds of types: types with fixed-length instances have a "
+"zero :c:member:`!tp_itemsize` field, types with variable-length instances "
+"have a non-zero :c:member:`!tp_itemsize` field. For a type with fixed-"
+"length instances, all instances have the same size, given in :c:member:`!"
+"tp_basicsize`. (Exceptions to this rule can be made "
+"using :c:func:`PyUnstable_Object_GC_NewWithExtraData`.)"
msgstr ""
-#: ../../c-api/typeobj.rst:599
+#: ../../c-api/typeobj.rst:604
msgid ""
-"For a type with variable-length instances, the instances must have an :c:"
-"member:`~PyVarObject.ob_size` field, and the instance size is :c:member:"
-"`~PyTypeObject.tp_basicsize` plus N times :c:member:`~PyTypeObject."
-"tp_itemsize`, where N is the \"length\" of the object. The value of N is "
-"typically stored in the instance's :c:member:`~PyVarObject.ob_size` field. "
-"There are exceptions: for example, ints use a negative :c:member:"
-"`~PyVarObject.ob_size` to indicate a negative number, and N is "
-"``abs(ob_size)`` there. Also, the presence of an :c:member:`~PyVarObject."
-"ob_size` field in the instance layout doesn't mean that the instance "
-"structure is variable-length (for example, the structure for the list type "
-"has fixed-length instances, yet those instances have a meaningful :c:member:"
-"`~PyVarObject.ob_size` field)."
+"For a type with variable-length instances, the instances must have "
+"an :c:member:`~PyVarObject.ob_size` field, and the instance size "
+"is :c:member:`!tp_basicsize` plus N times :c:member:`!tp_itemsize`, where N "
+"is the \"length\" of the object."
msgstr ""
-#: ../../c-api/typeobj.rst:610
+#: ../../c-api/typeobj.rst:609
msgid ""
-"The basic size includes the fields in the instance declared by the macro :c:"
-"macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD` (whichever is used to "
-"declare the instance struct) and this in turn includes the :c:member:"
-"`~PyObject._ob_prev` and :c:member:`~PyObject._ob_next` fields if they are "
-"present. This means that the only correct way to get an initializer for "
-"the :c:member:`~PyTypeObject.tp_basicsize` is to use the ``sizeof`` operator "
-"on the struct used to declare the instance layout. The basic size does not "
-"include the GC header size."
+"Functions like :c:func:`PyObject_NewVar` will take the value of N as an "
+"argument, and store in the instance's :c:member:`~PyVarObject.ob_size` "
+"field. Note that the :c:member:`~PyVarObject.ob_size` field may later be "
+"used for other purposes. For example, :py:type:`int` instances use the bits "
+"of :c:member:`~PyVarObject.ob_size` in an implementation-defined way; the "
+"underlying storage and its size should be accessed "
+"using :c:func:`PyLong_Export`."
msgstr ""
-#: ../../c-api/typeobj.rst:618
+#: ../../c-api/typeobj.rst:619
msgid ""
-"A note about alignment: if the variable items require a particular "
-"alignment, this should be taken care of by the value of :c:member:"
-"`~PyTypeObject.tp_basicsize`. Example: suppose a type implements an array "
-"of ``double``. :c:member:`~PyTypeObject.tp_itemsize` is ``sizeof(double)``. "
-"It is the programmer's responsibility that :c:member:`~PyTypeObject."
-"tp_basicsize` is a multiple of ``sizeof(double)`` (assuming this is the "
-"alignment requirement for ``double``)."
+"The :c:member:`~PyVarObject.ob_size` field should be accessed using "
+"the :c:func:`Py_SIZE()` and :c:func:`Py_SET_SIZE()` macros."
msgstr ""
-#: ../../c-api/typeobj.rst:625
+#: ../../c-api/typeobj.rst:622
msgid ""
-"For any type with variable-length instances, this field must not be ``NULL``."
+"Also, the presence of an :c:member:`~PyVarObject.ob_size` field in the "
+"instance layout doesn't mean that the instance structure is variable-length. "
+"For example, the :py:type:`list` type has fixed-length instances, yet those "
+"instances have a :c:member:`~PyVarObject.ob_size` field. (As "
+"with :py:type:`int`, avoid reading lists' :c:member:`!ob_size` directly. "
+"Call :c:func:`PyList_Size` instead.)"
msgstr ""
#: ../../c-api/typeobj.rst:629
msgid ""
-"These fields are inherited separately by subtypes. If the base type has a "
-"non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is generally not safe to "
-"set :c:member:`~PyTypeObject.tp_itemsize` to a different non-zero value in a "
-"subtype (though this depends on the implementation of the base type)."
+"The :c:member:`!tp_basicsize` includes size needed for data of the "
+"type's :c:member:`~PyTypeObject.tp_base`, plus any extra data needed by each "
+"instance."
+msgstr ""
+
+#: ../../c-api/typeobj.rst:633
+msgid ""
+"The correct way to set :c:member:`!tp_basicsize` is to use the ``sizeof`` "
+"operator on the struct used to declare the instance layout. This struct must "
+"include the struct used to declare the base type. In other "
+"words, :c:member:`!tp_basicsize` must be greater than or equal to the "
+"base's :c:member:`!tp_basicsize`."
+msgstr ""
+
+#: ../../c-api/typeobj.rst:639
+msgid ""
+"Since every type is a subtype of :py:type:`object`, this struct must "
+"include :c:type:`PyObject` or :c:type:`PyVarObject` (depending on "
+"whether :c:member:`~PyVarObject.ob_size` should be included). These are "
+"usually defined by the macro :c:macro:`PyObject_HEAD` "
+"or :c:macro:`PyObject_VAR_HEAD`, respectively."
+msgstr ""
+
+#: ../../c-api/typeobj.rst:645
+msgid ""
+"The basic size does not include the GC header size, as that header is not "
+"part of :c:macro:`PyObject_HEAD`."
+msgstr ""
+
+#: ../../c-api/typeobj.rst:648
+msgid ""
+"For cases where struct used to declare the base type is unknown, "
+"see :c:member:`PyType_Spec.basicsize` and :c:func:`PyType_FromMetaclass`."
+msgstr ""
+
+#: ../../c-api/typeobj.rst:651
+msgid "Notes about alignment:"
+msgstr ""
+
+#: ../../c-api/typeobj.rst:653
+msgid ""
+":c:member:`!tp_basicsize` must be a multiple of ``_Alignof(PyObject)``. When "
+"using ``sizeof`` on a ``struct`` that includes :c:macro:`PyObject_HEAD`, as "
+"recommended, the compiler ensures this. When not using a C ``struct``, or "
+"when using compiler extensions like ``__attribute__((packed))``, it is up to "
+"you."
+msgstr ""
+
+#: ../../c-api/typeobj.rst:658
+msgid ""
+"If the variable items require a particular alignment, :c:member:`!"
+"tp_basicsize` and :c:member:`!tp_itemsize` must each be a multiple of that "
+"alignment. For example, if a type's variable part stores a ``double``, it is "
+"your responsibility that both fields are a multiple of ``_Alignof(double)``."
+msgstr ""
+
+#: ../../c-api/typeobj.rst:667
+msgid ""
+"These fields are inherited separately by subtypes. (That is, if the field is "
+"set to zero, :c:func:`PyType_Ready` will copy the value from the base type, "
+"indicating that the instances do not need additional storage.)"
msgstr ""
-#: ../../c-api/typeobj.rst:637
+#: ../../c-api/typeobj.rst:672
+msgid ""
+"If the base type has a non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is "
+"generally not safe to set :c:member:`~PyTypeObject.tp_itemsize` to a "
+"different non-zero value in a subtype (though this depends on the "
+"implementation of the base type)."
+msgstr ""
+
+#: ../../c-api/typeobj.rst:679
msgid ""
"A pointer to the instance destructor function. This function must be "
"defined unless the type guarantees that its instances will never be "
@@ -1504,36 +1570,38 @@ msgid ""
"The function signature is::"
msgstr ""
-#: ../../c-api/typeobj.rst:641
+#: ../../c-api/typeobj.rst:683
msgid "void tp_dealloc(PyObject *self);"
msgstr "void tp_dealloc(PyObject *self);"
-#: ../../c-api/typeobj.rst:643
-msgid ""
-"The destructor function is called by the :c:func:`Py_DECREF` and :c:func:"
-"`Py_XDECREF` macros when the new reference count is zero. At this point, "
-"the instance is still in existence, but there are no references to it. The "
-"destructor function should free all references which the instance owns, free "
-"all memory buffers owned by the instance (using the freeing function "
-"corresponding to the allocation function used to allocate the buffer), and "
-"call the type's :c:member:`~PyTypeObject.tp_free` function. If the type is "
-"not subtypable (doesn't have the :c:macro:`Py_TPFLAGS_BASETYPE` flag bit "
-"set), it is permissible to call the object deallocator directly instead of "
+#: ../../c-api/typeobj.rst:685
+msgid ""
+"The destructor function is called by the :c:func:`Py_DECREF` "
+"and :c:func:`Py_XDECREF` macros when the new reference count is zero. At "
+"this point, the instance is still in existence, but there are no references "
+"to it. The destructor function should free all references which the "
+"instance owns, free all memory buffers owned by the instance (using the "
+"freeing function corresponding to the allocation function used to allocate "
+"the buffer), and call the type's :c:member:`~PyTypeObject.tp_free` "
+"function. If the type is not subtypable (doesn't have "
+"the :c:macro:`Py_TPFLAGS_BASETYPE` flag bit set), it is permissible to call "
+"the object deallocator directly instead of "
"via :c:member:`~PyTypeObject.tp_free`. The object deallocator should be the "
"one used to allocate the instance; this is normally :c:func:`PyObject_Del` "
-"if the instance was allocated using :c:macro:`PyObject_New` or :c:macro:"
-"`PyObject_NewVar`, or :c:func:`PyObject_GC_Del` if the instance was "
-"allocated using :c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar`."
+"if the instance was allocated using :c:macro:`PyObject_New` "
+"or :c:macro:`PyObject_NewVar`, or :c:func:`PyObject_GC_Del` if the instance "
+"was allocated using :c:macro:`PyObject_GC_New` "
+"or :c:macro:`PyObject_GC_NewVar`."
msgstr ""
-#: ../../c-api/typeobj.rst:658
+#: ../../c-api/typeobj.rst:700
msgid ""
-"If the type supports garbage collection (has the :c:macro:"
-"`Py_TPFLAGS_HAVE_GC` flag bit set), the destructor should call :c:func:"
-"`PyObject_GC_UnTrack` before clearing any member fields."
+"If the type supports garbage collection (has "
+"the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit set), the destructor should "
+"call :c:func:`PyObject_GC_UnTrack` before clearing any member fields."
msgstr ""
-#: ../../c-api/typeobj.rst:662
+#: ../../c-api/typeobj.rst:704
msgid ""
"static void foo_dealloc(foo_object *self) {\n"
" PyObject_GC_UnTrack(self);\n"
@@ -1547,15 +1615,15 @@ msgstr ""
" Py_TYPE(self)->tp_free((PyObject *)self);\n"
"}"
-#: ../../c-api/typeobj.rst:670
+#: ../../c-api/typeobj.rst:712
msgid ""
"Finally, if the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the "
-"deallocator should release the owned reference to its type object (via :c:"
-"func:`Py_DECREF`) after calling the type deallocator. In order to avoid "
-"dangling pointers, the recommended way to achieve this is:"
+"deallocator should release the owned reference to its type object "
+"(via :c:func:`Py_DECREF`) after calling the type deallocator. In order to "
+"avoid dangling pointers, the recommended way to achieve this is:"
msgstr ""
-#: ../../c-api/typeobj.rst:676
+#: ../../c-api/typeobj.rst:718
msgid ""
"static void foo_dealloc(foo_object *self) {\n"
" PyTypeObject *tp = Py_TYPE(self);\n"
@@ -1565,7 +1633,7 @@ msgid ""
"}"
msgstr ""
-#: ../../c-api/typeobj.rst:687
+#: ../../c-api/typeobj.rst:729
msgid ""
"In a garbage collected Python, :c:member:`!tp_dealloc` may be called from "
"any Python thread, not just the thread which created the object (if the "
@@ -1574,68 +1642,69 @@ msgid ""
"calls, since the thread on which :c:member:`!tp_dealloc` is called will own "
"the Global Interpreter Lock (GIL). However, if the object being destroyed "
"in turn destroys objects from some other C or C++ library, care should be "
-"taken to ensure that destroying those objects on the thread which called :c:"
-"member:`!tp_dealloc` will not violate any assumptions of the library."
+"taken to ensure that destroying those objects on the thread which "
+"called :c:member:`!tp_dealloc` will not violate any assumptions of the "
+"library."
msgstr ""
-#: ../../c-api/typeobj.rst:706
+#: ../../c-api/typeobj.rst:748
msgid ""
"An optional offset to a per-instance function that implements calling the "
"object using the :ref:`vectorcall protocol `, a more efficient "
"alternative of the simpler :c:member:`~PyTypeObject.tp_call`."
msgstr ""
-#: ../../c-api/typeobj.rst:711
+#: ../../c-api/typeobj.rst:753
msgid ""
"This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is "
"set. If so, this must be a positive integer containing the offset in the "
"instance of a :c:type:`vectorcallfunc` pointer."
msgstr ""
-#: ../../c-api/typeobj.rst:715
+#: ../../c-api/typeobj.rst:757
msgid ""
"The *vectorcallfunc* pointer may be ``NULL``, in which case the instance "
"behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the "
"instance falls back to :c:member:`~PyTypeObject.tp_call`."
msgstr ""
-#: ../../c-api/typeobj.rst:719
+#: ../../c-api/typeobj.rst:761
msgid ""
-"Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:"
-"`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the "
-"*vectorcallfunc* function. This can be done by setting *tp_call* to :c:func:"
-"`PyVectorcall_Call`."
+"Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also "
+"set :c:member:`~PyTypeObject.tp_call` and make sure its behaviour is "
+"consistent with the *vectorcallfunc* function. This can be done by setting "
+"*tp_call* to :c:func:`PyVectorcall_Call`."
msgstr ""
-#: ../../c-api/typeobj.rst:726
+#: ../../c-api/typeobj.rst:768
msgid ""
"Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was "
"used for printing to a file. In Python 3.0 to 3.7, it was unused."
msgstr ""
-#: ../../c-api/typeobj.rst:732
+#: ../../c-api/typeobj.rst:774
msgid ""
"Before version 3.12, it was not recommended for :ref:`mutable heap types "
-"` to implement the vectorcall protocol. When a user sets :attr:"
-"`~object.__call__` in Python code, only *tp_call* is updated, likely making "
-"it inconsistent with the vectorcall function. Since 3.12, setting "
-"``__call__`` will disable vectorcall optimization by clearing the :c:macro:"
-"`Py_TPFLAGS_HAVE_VECTORCALL` flag."
+"` to implement the vectorcall protocol. When a user "
+"sets :attr:`~object.__call__` in Python code, only *tp_call* is updated, "
+"likely making it inconsistent with the vectorcall function. Since 3.12, "
+"setting ``__call__`` will disable vectorcall optimization by clearing "
+"the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag."
msgstr ""
-#: ../../c-api/typeobj.rst:742
+#: ../../c-api/typeobj.rst:784
msgid ""
-"This field is always inherited. However, the :c:macro:"
-"`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, "
-"then the subclass won't use :ref:`vectorcall `, except when :c:"
-"func:`PyVectorcall_Call` is explicitly called."
+"This field is always inherited. However, "
+"the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If "
+"it's not set, then the subclass won't use :ref:`vectorcall `, "
+"except when :c:func:`PyVectorcall_Call` is explicitly called."
msgstr ""
-#: ../../c-api/typeobj.rst:751
+#: ../../c-api/typeobj.rst:793
msgid "An optional pointer to the get-attribute-string function."
msgstr ""
-#: ../../c-api/typeobj.rst:753
+#: ../../c-api/typeobj.rst:795
msgid ""
"This field is deprecated. When it is defined, it should point to a function "
"that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, "
@@ -1643,29 +1712,28 @@ msgid ""
"attribute name."
msgstr ""
-#: ../../c-api/typeobj.rst:759 ../../c-api/typeobj.rst:955
-msgid ""
-"Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject."
-"tp_getattro`"
+#: ../../c-api/typeobj.rst:801 ../../c-api/typeobj.rst:997
+msgid "Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject.tp_getattro`"
msgstr ""
-"群組::c:member:`~PyTypeObject.tp_getattr`、:c:member:`~PyTypeObject."
-"tp_getattro`"
+"群"
+"組::c:member:`~PyTypeObject.tp_getattr`、:c:member:`~PyTypeObject.tp_getattro`"
-#: ../../c-api/typeobj.rst:761
+#: ../../c-api/typeobj.rst:803
msgid ""
-"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
-"tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` "
+"This field is inherited by subtypes together "
+"with :c:member:`~PyTypeObject.tp_getattro`: a subtype inherits "
+"both :c:member:`~PyTypeObject.tp_getattr` "
"and :c:member:`~PyTypeObject.tp_getattro` from its base type when the "
-"subtype's :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject."
-"tp_getattro` are both ``NULL``."
+"subtype's :c:member:`~PyTypeObject.tp_getattr` "
+"and :c:member:`~PyTypeObject.tp_getattro` are both ``NULL``."
msgstr ""
-#: ../../c-api/typeobj.rst:768 ../../c-api/typeobj.rst:968
+#: ../../c-api/typeobj.rst:810 ../../c-api/typeobj.rst:1010
msgid ""
"An optional pointer to the function for setting and deleting attributes."
msgstr ""
-#: ../../c-api/typeobj.rst:770
+#: ../../c-api/typeobj.rst:812
msgid ""
"This field is deprecated. When it is defined, it should point to a function "
"that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, "
@@ -1673,55 +1741,54 @@ msgid ""
"attribute name."
msgstr ""
-#: ../../c-api/typeobj.rst:776 ../../c-api/typeobj.rst:981
-msgid ""
-"Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject."
-"tp_setattro`"
+#: ../../c-api/typeobj.rst:818 ../../c-api/typeobj.rst:1023
+msgid "Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject.tp_setattro`"
msgstr ""
-"群組::c:member:`~PyTypeObject.tp_setattr`、:c:member:`~PyTypeObject."
-"tp_setattro`"
+"群"
+"組::c:member:`~PyTypeObject.tp_setattr`、:c:member:`~PyTypeObject.tp_setattro`"
-#: ../../c-api/typeobj.rst:778
+#: ../../c-api/typeobj.rst:820
msgid ""
-"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
-"tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` "
+"This field is inherited by subtypes together "
+"with :c:member:`~PyTypeObject.tp_setattro`: a subtype inherits "
+"both :c:member:`~PyTypeObject.tp_setattr` "
"and :c:member:`~PyTypeObject.tp_setattro` from its base type when the "
-"subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject."
-"tp_setattro` are both ``NULL``."
+"subtype's :c:member:`~PyTypeObject.tp_setattr` "
+"and :c:member:`~PyTypeObject.tp_setattro` are both ``NULL``."
msgstr ""
-#: ../../c-api/typeobj.rst:785
+#: ../../c-api/typeobj.rst:827
msgid ""
"Pointer to an additional structure that contains fields relevant only to "
"objects which implement :term:`awaitable` and :term:`asynchronous iterator` "
"protocols at the C-level. See :ref:`async-structs` for details."
msgstr ""
-#: ../../c-api/typeobj.rst:789
+#: ../../c-api/typeobj.rst:831
msgid "Formerly known as ``tp_compare`` and ``tp_reserved``."
msgstr ""
-#: ../../c-api/typeobj.rst:794
+#: ../../c-api/typeobj.rst:836
msgid ""
"The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the "
"contained fields are inherited individually."
msgstr ""
-#: ../../c-api/typeobj.rst:802
+#: ../../c-api/typeobj.rst:844
msgid ""
-"An optional pointer to a function that implements the built-in function :"
-"func:`repr`."
+"An optional pointer to a function that implements the built-in "
+"function :func:`repr`."
msgstr ""
-#: ../../c-api/typeobj.rst:805
+#: ../../c-api/typeobj.rst:847
msgid "The signature is the same as for :c:func:`PyObject_Repr`::"
msgstr ""
-#: ../../c-api/typeobj.rst:807
+#: ../../c-api/typeobj.rst:849
msgid "PyObject *tp_repr(PyObject *self);"
msgstr "PyObject *tp_repr(PyObject *self);"
-#: ../../c-api/typeobj.rst:809
+#: ../../c-api/typeobj.rst:851
msgid ""
"The function must return a string or a Unicode object. Ideally, this "
"function should return a string that, when passed to :func:`eval`, given a "
@@ -1730,153 +1797,152 @@ msgid ""
"``'>'`` from which both the type and the value of the object can be deduced."
msgstr ""
-#: ../../c-api/typeobj.rst:820 ../../c-api/typeobj.rst:899
-#: ../../c-api/typeobj.rst:936 ../../c-api/typeobj.rst:961
-#: ../../c-api/typeobj.rst:987 ../../c-api/typeobj.rst:1028
-#: ../../c-api/typeobj.rst:1583 ../../c-api/typeobj.rst:1617
-#: ../../c-api/typeobj.rst:1734 ../../c-api/typeobj.rst:1767
-#: ../../c-api/typeobj.rst:1842 ../../c-api/typeobj.rst:1883
-#: ../../c-api/typeobj.rst:1901 ../../c-api/typeobj.rst:1943
-#: ../../c-api/typeobj.rst:1964 ../../c-api/typeobj.rst:1995
+#: ../../c-api/typeobj.rst:862 ../../c-api/typeobj.rst:941
+#: ../../c-api/typeobj.rst:978 ../../c-api/typeobj.rst:1003
+#: ../../c-api/typeobj.rst:1029 ../../c-api/typeobj.rst:1070
+#: ../../c-api/typeobj.rst:1625 ../../c-api/typeobj.rst:1659
+#: ../../c-api/typeobj.rst:1776 ../../c-api/typeobj.rst:1809
+#: ../../c-api/typeobj.rst:1884 ../../c-api/typeobj.rst:1925
+#: ../../c-api/typeobj.rst:1943 ../../c-api/typeobj.rst:1985
+#: ../../c-api/typeobj.rst:2006 ../../c-api/typeobj.rst:2037
msgid "**Default:**"
msgstr "**預設:**"
-#: ../../c-api/typeobj.rst:822
+#: ../../c-api/typeobj.rst:864
msgid ""
"When this field is not set, a string of the form ``<%s object at %p>`` is "
"returned, where ``%s`` is replaced by the type name, and ``%p`` by the "
"object's memory address."
msgstr ""
-#: ../../c-api/typeobj.rst:829
+#: ../../c-api/typeobj.rst:871
msgid ""
"Pointer to an additional structure that contains fields relevant only to "
"objects which implement the number protocol. These fields are documented "
"in :ref:`number-structs`."
msgstr ""
-#: ../../c-api/typeobj.rst:835
+#: ../../c-api/typeobj.rst:877
msgid ""
"The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the "
"contained fields are inherited individually."
msgstr ""
-#: ../../c-api/typeobj.rst:841
+#: ../../c-api/typeobj.rst:883
msgid ""
"Pointer to an additional structure that contains fields relevant only to "
"objects which implement the sequence protocol. These fields are documented "
"in :ref:`sequence-structs`."
msgstr ""
-#: ../../c-api/typeobj.rst:847
+#: ../../c-api/typeobj.rst:889
msgid ""
"The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the "
"contained fields are inherited individually."
msgstr ""
-#: ../../c-api/typeobj.rst:853
+#: ../../c-api/typeobj.rst:895
msgid ""
"Pointer to an additional structure that contains fields relevant only to "
"objects which implement the mapping protocol. These fields are documented "
"in :ref:`mapping-structs`."
msgstr ""
-#: ../../c-api/typeobj.rst:859
+#: ../../c-api/typeobj.rst:901
msgid ""
"The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the "
"contained fields are inherited individually."
msgstr ""
-#: ../../c-api/typeobj.rst:867
+#: ../../c-api/typeobj.rst:909
msgid ""
-"An optional pointer to a function that implements the built-in function :"
-"func:`hash`."
+"An optional pointer to a function that implements the built-in "
+"function :func:`hash`."
msgstr ""
-#: ../../c-api/typeobj.rst:870
+#: ../../c-api/typeobj.rst:912
msgid "The signature is the same as for :c:func:`PyObject_Hash`::"
msgstr ""
-#: ../../c-api/typeobj.rst:872
+#: ../../c-api/typeobj.rst:914
msgid "Py_hash_t tp_hash(PyObject *);"
msgstr "Py_hash_t tp_hash(PyObject *);"
-#: ../../c-api/typeobj.rst:874
+#: ../../c-api/typeobj.rst:916
msgid ""
"The value ``-1`` should not be returned as a normal return value; when an "
"error occurs during the computation of the hash value, the function should "
"set an exception and return ``-1``."
msgstr ""
-#: ../../c-api/typeobj.rst:878
+#: ../../c-api/typeobj.rst:920
msgid ""
"When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` "
-"is not set), an attempt to take the hash of the object raises :exc:"
-"`TypeError`. This is the same as setting it to :c:func:"
-"`PyObject_HashNotImplemented`."
+"is not set), an attempt to take the hash of the object "
+"raises :exc:`TypeError`. This is the same as setting it "
+"to :c:func:`PyObject_HashNotImplemented`."
msgstr ""
-#: ../../c-api/typeobj.rst:882
+#: ../../c-api/typeobj.rst:924
msgid ""
"This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to "
"block inheritance of the hash method from a parent type. This is interpreted "
"as the equivalent of ``__hash__ = None`` at the Python level, causing "
"``isinstance(o, collections.Hashable)`` to correctly return ``False``. Note "
"that the converse is also true - setting ``__hash__ = None`` on a class at "
-"the Python level will result in the ``tp_hash`` slot being set to :c:func:"
-"`PyObject_HashNotImplemented`."
+"the Python level will result in the ``tp_hash`` slot being set "
+"to :c:func:`PyObject_HashNotImplemented`."
msgstr ""
-#: ../../c-api/typeobj.rst:892 ../../c-api/typeobj.rst:1576
-msgid ""
-"Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject."
-"tp_richcompare`"
+#: ../../c-api/typeobj.rst:934 ../../c-api/typeobj.rst:1618
+msgid "Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject.tp_richcompare`"
msgstr ""
-"群組::c:member:`~PyTypeObject.tp_hash`、:c:member:`~PyTypeObject."
-"tp_richcompare`"
+"群"
+"組::c:member:`~PyTypeObject.tp_hash`、:c:member:`~PyTypeObject.tp_richcompare`"
-#: ../../c-api/typeobj.rst:894
+#: ../../c-api/typeobj.rst:936
msgid ""
-"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
-"tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject."
-"tp_richcompare` and :c:member:`~PyTypeObject.tp_hash`, when the subtype's :c:"
-"member:`~PyTypeObject.tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` "
-"are both ``NULL``."
+"This field is inherited by subtypes together "
+"with :c:member:`~PyTypeObject.tp_richcompare`: a subtype inherits both "
+"of :c:member:`~PyTypeObject.tp_richcompare` "
+"and :c:member:`~PyTypeObject.tp_hash`, when the "
+"subtype's :c:member:`~PyTypeObject.tp_richcompare` "
+"and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``."
msgstr ""
-#: ../../c-api/typeobj.rst:901
+#: ../../c-api/typeobj.rst:943
msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericHash`."
msgstr ""
-#: ../../c-api/typeobj.rst:906
+#: ../../c-api/typeobj.rst:948
msgid ""
"An optional pointer to a function that implements calling the object. This "
"should be ``NULL`` if the object is not callable. The signature is the same "
"as for :c:func:`PyObject_Call`::"
msgstr ""
-#: ../../c-api/typeobj.rst:910
+#: ../../c-api/typeobj.rst:952
msgid "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);"
msgstr "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);"
-#: ../../c-api/typeobj.rst:919
+#: ../../c-api/typeobj.rst:961
msgid ""
-"An optional pointer to a function that implements the built-in operation :"
-"func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls "
-"the constructor for that type. This constructor calls :c:func:"
-"`PyObject_Str` to do the actual work, and :c:func:`PyObject_Str` will call "
-"this handler.)"
+"An optional pointer to a function that implements the built-in "
+"operation :func:`str`. (Note that :class:`str` is a type now, "
+"and :func:`str` calls the constructor for that type. This constructor "
+"calls :c:func:`PyObject_Str` to do the actual work, "
+"and :c:func:`PyObject_Str` will call this handler.)"
msgstr ""
-#: ../../c-api/typeobj.rst:924
+#: ../../c-api/typeobj.rst:966
msgid "The signature is the same as for :c:func:`PyObject_Str`::"
msgstr ""
-#: ../../c-api/typeobj.rst:926
+#: ../../c-api/typeobj.rst:968
msgid "PyObject *tp_str(PyObject *self);"
msgstr "PyObject *tp_str(PyObject *self);"
-#: ../../c-api/typeobj.rst:928
+#: ../../c-api/typeobj.rst:970
msgid ""
"The function must return a string or a Unicode object. It should be a "
"\"friendly\" string representation of the object, as this is the "
@@ -1884,99 +1950,101 @@ msgid ""
"function."
msgstr ""
-#: ../../c-api/typeobj.rst:938
+#: ../../c-api/typeobj.rst:980
msgid ""
"When this field is not set, :c:func:`PyObject_Repr` is called to return a "
"string representation."
msgstr ""
-#: ../../c-api/typeobj.rst:944
+#: ../../c-api/typeobj.rst:986
msgid "An optional pointer to the get-attribute function."
msgstr ""
-#: ../../c-api/typeobj.rst:946
+#: ../../c-api/typeobj.rst:988
msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::"
msgstr ""
-#: ../../c-api/typeobj.rst:948
+#: ../../c-api/typeobj.rst:990
msgid "PyObject *tp_getattro(PyObject *self, PyObject *attr);"
msgstr "PyObject *tp_getattro(PyObject *self, PyObject *attr);"
-#: ../../c-api/typeobj.rst:950
+#: ../../c-api/typeobj.rst:992
msgid ""
-"It is usually convenient to set this field to :c:func:"
-"`PyObject_GenericGetAttr`, which implements the normal way of looking for "
-"object attributes."
+"It is usually convenient to set this field "
+"to :c:func:`PyObject_GenericGetAttr`, which implements the normal way of "
+"looking for object attributes."
msgstr ""
-#: ../../c-api/typeobj.rst:957
+#: ../../c-api/typeobj.rst:999
msgid ""
-"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
-"tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` "
+"This field is inherited by subtypes together "
+"with :c:member:`~PyTypeObject.tp_getattr`: a subtype inherits "
+"both :c:member:`~PyTypeObject.tp_getattr` "
"and :c:member:`~PyTypeObject.tp_getattro` from its base type when the "
-"subtype's :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject."
-"tp_getattro` are both ``NULL``."
+"subtype's :c:member:`~PyTypeObject.tp_getattr` "
+"and :c:member:`~PyTypeObject.tp_getattro` are both ``NULL``."
msgstr ""
-#: ../../c-api/typeobj.rst:963
+#: ../../c-api/typeobj.rst:1005
msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`."
msgstr ""
-#: ../../c-api/typeobj.rst:970
+#: ../../c-api/typeobj.rst:1012
msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::"
msgstr ""
-#: ../../c-api/typeobj.rst:972
+#: ../../c-api/typeobj.rst:1014
msgid "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);"
msgstr "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);"
-#: ../../c-api/typeobj.rst:974
+#: ../../c-api/typeobj.rst:1016
msgid ""
"In addition, setting *value* to ``NULL`` to delete an attribute must be "
-"supported. It is usually convenient to set this field to :c:func:"
-"`PyObject_GenericSetAttr`, which implements the normal way of setting object "
-"attributes."
+"supported. It is usually convenient to set this field "
+"to :c:func:`PyObject_GenericSetAttr`, which implements the normal way of "
+"setting object attributes."
msgstr ""
-#: ../../c-api/typeobj.rst:983
+#: ../../c-api/typeobj.rst:1025
msgid ""
-"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
-"tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` "
+"This field is inherited by subtypes together "
+"with :c:member:`~PyTypeObject.tp_setattr`: a subtype inherits "
+"both :c:member:`~PyTypeObject.tp_setattr` "
"and :c:member:`~PyTypeObject.tp_setattro` from its base type when the "
-"subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject."
-"tp_setattro` are both ``NULL``."
+"subtype's :c:member:`~PyTypeObject.tp_setattr` "
+"and :c:member:`~PyTypeObject.tp_setattro` are both ``NULL``."
msgstr ""
-#: ../../c-api/typeobj.rst:989
+#: ../../c-api/typeobj.rst:1031
msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`."
msgstr ""
-#: ../../c-api/typeobj.rst:994
+#: ../../c-api/typeobj.rst:1036
msgid ""
"Pointer to an additional structure that contains fields relevant only to "
"objects which implement the buffer interface. These fields are documented "
"in :ref:`buffer-structs`."
msgstr ""
-#: ../../c-api/typeobj.rst:1000
+#: ../../c-api/typeobj.rst:1042
msgid ""
"The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the "
"contained fields are inherited individually."
msgstr ""
-#: ../../c-api/typeobj.rst:1006
+#: ../../c-api/typeobj.rst:1048
msgid ""
"This field is a bit mask of various flags. Some flags indicate variant "
"semantics for certain situations; others are used to indicate that certain "
-"fields in the type object (or in the extension structures referenced via :c:"
-"member:`~PyTypeObject.tp_as_number`, :c:member:`~PyTypeObject."
-"tp_as_sequence`, :c:member:`~PyTypeObject.tp_as_mapping`, and :c:member:"
-"`~PyTypeObject.tp_as_buffer`) that were historically not always present are "
-"valid; if such a flag bit is clear, the type fields it guards must not be "
-"accessed and must be considered to have a zero or ``NULL`` value instead."
+"fields in the type object (or in the extension structures referenced "
+"via :c:member:`~PyTypeObject.tp_as_number`, :c:member:`~PyTypeObject.tp_as_sequence`, :c:member:`~PyTypeObject.tp_as_mapping`, "
+"and :c:member:`~PyTypeObject.tp_as_buffer`) that were historically not "
+"always present are valid; if such a flag bit is clear, the type fields it "
+"guards must not be accessed and must be considered to have a zero or "
+"``NULL`` value instead."
msgstr ""
-#: ../../c-api/typeobj.rst:1016
+#: ../../c-api/typeobj.rst:1058
msgid ""
"Inheritance of this field is complicated. Most flag bits are inherited "
"individually, i.e. if the base type has a flag bit set, the subtype inherits "
@@ -1985,14 +2053,14 @@ msgid ""
"type's value of the flag bit is copied into the subtype together with a "
"pointer to the extension structure. The :c:macro:`Py_TPFLAGS_HAVE_GC` flag "
"bit is inherited together with the :c:member:`~PyTypeObject.tp_traverse` "
-"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :c:macro:"
-"`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :c:member:"
-"`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields in "
-"the subtype exist and have ``NULL`` values. .. XXX are most flag bits "
-"*really* inherited individually?"
+"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if "
+"the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and "
+"the :c:member:`~PyTypeObject.tp_traverse` "
+"and :c:member:`~PyTypeObject.tp_clear` fields in the subtype exist and have "
+"``NULL`` values. .. XXX are most flag bits *really* inherited individually?"
msgstr ""
-#: ../../c-api/typeobj.rst:1030
+#: ../../c-api/typeobj.rst:1072
msgid ""
":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | "
"Py_TPFLAGS_BASETYPE``."
@@ -2000,20 +2068,20 @@ msgstr ""
":c:data:`PyBaseObject_Type` 使用 ``Py_TPFLAGS_DEFAULT | "
"Py_TPFLAGS_BASETYPE``。"
-#: ../../c-api/typeobj.rst:1033
+#: ../../c-api/typeobj.rst:1075
msgid "**Bit Masks:**"
msgstr ""
-#: ../../c-api/typeobj.rst:1037
+#: ../../c-api/typeobj.rst:1079
msgid ""
"The following bit masks are currently defined; these can be ORed together "
-"using the ``|`` operator to form the value of the :c:member:`~PyTypeObject."
-"tp_flags` field. The macro :c:func:`PyType_HasFeature` takes a type and a "
-"flags value, *tp* and *f*, and checks whether ``tp->tp_flags & f`` is non-"
-"zero."
+"using the ``|`` operator to form the value of "
+"the :c:member:`~PyTypeObject.tp_flags` field. The "
+"macro :c:func:`PyType_HasFeature` takes a type and a flags value, *tp* and "
+"*f*, and checks whether ``tp->tp_flags & f`` is non-zero."
msgstr ""
-#: ../../c-api/typeobj.rst:1044
+#: ../../c-api/typeobj.rst:1086
msgid ""
"This bit is set when the type object itself is allocated on the heap, for "
"example, types created dynamically using :c:func:`PyType_FromSpec`. In this "
@@ -2021,255 +2089,257 @@ msgid ""
"a reference to the type, and the type object is INCREF'ed when a new "
"instance is created, and DECREF'ed when an instance is destroyed (this does "
"not apply to instances of subtypes; only the type referenced by the "
-"instance's ob_type gets INCREF'ed or DECREF'ed). Heap types should also :ref:"
-"`support garbage collection ` as they can form a "
-"reference cycle with their own module object."
+"instance's ob_type gets INCREF'ed or DECREF'ed). Heap types should "
+"also :ref:`support garbage collection ` as they "
+"can form a reference cycle with their own module object."
msgstr ""
-#: ../../c-api/typeobj.rst:1055 ../../c-api/typeobj.rst:1066
-#: ../../c-api/typeobj.rst:1076 ../../c-api/typeobj.rst:1086
-#: ../../c-api/typeobj.rst:1118
+#: ../../c-api/typeobj.rst:1097 ../../c-api/typeobj.rst:1108
+#: ../../c-api/typeobj.rst:1118 ../../c-api/typeobj.rst:1128
+#: ../../c-api/typeobj.rst:1160
msgid "???"
msgstr "???"
-#: ../../c-api/typeobj.rst:1060
+#: ../../c-api/typeobj.rst:1102
msgid ""
"This bit is set when the type can be used as the base type of another type. "
"If this bit is clear, the type cannot be subtyped (similar to a \"final\" "
"class in Java)."
msgstr ""
-#: ../../c-api/typeobj.rst:1071
+#: ../../c-api/typeobj.rst:1113
msgid ""
-"This bit is set when the type object has been fully initialized by :c:func:"
-"`PyType_Ready`."
+"This bit is set when the type object has been fully initialized "
+"by :c:func:`PyType_Ready`."
msgstr ""
-#: ../../c-api/typeobj.rst:1081
+#: ../../c-api/typeobj.rst:1123
msgid ""
"This bit is set while :c:func:`PyType_Ready` is in the process of "
"initializing the type object."
msgstr ""
-#: ../../c-api/typeobj.rst:1091
+#: ../../c-api/typeobj.rst:1133
msgid ""
"This bit is set when the object supports garbage collection. If this bit is "
"set, instances must be created using :c:macro:`PyObject_GC_New` and "
-"destroyed using :c:func:`PyObject_GC_Del`. More information in section :ref:"
-"`supporting-cycle-detection`. This bit also implies that the GC-related "
-"fields :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject."
-"tp_clear` are present in the type object."
+"destroyed using :c:func:`PyObject_GC_Del`. More information in "
+"section :ref:`supporting-cycle-detection`. This bit also implies that the "
+"GC-related fields :c:member:`~PyTypeObject.tp_traverse` "
+"and :c:member:`~PyTypeObject.tp_clear` are present in the type object."
msgstr ""
-#: ../../c-api/typeobj.rst:1100 ../../c-api/typeobj.rst:1441
-#: ../../c-api/typeobj.rst:1515
-msgid ""
-"Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject."
-"tp_traverse`, :c:member:`~PyTypeObject.tp_clear`"
+#: ../../c-api/typeobj.rst:1142 ../../c-api/typeobj.rst:1483
+#: ../../c-api/typeobj.rst:1557
+msgid "Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject.tp_traverse`, :c:member:`~PyTypeObject.tp_clear`"
msgstr ""
-#: ../../c-api/typeobj.rst:1102
+#: ../../c-api/typeobj.rst:1144
msgid ""
-"The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :c:"
-"member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` "
-"fields, i.e. if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the "
-"subtype and the :c:member:`~PyTypeObject.tp_traverse` and :c:member:"
-"`~PyTypeObject.tp_clear` fields in the subtype exist and have ``NULL`` "
-"values."
+"The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with "
+"the :c:member:`~PyTypeObject.tp_traverse` "
+"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if "
+"the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and "
+"the :c:member:`~PyTypeObject.tp_traverse` "
+"and :c:member:`~PyTypeObject.tp_clear` fields in the subtype exist and have "
+"``NULL`` values."
msgstr ""
-#: ../../c-api/typeobj.rst:1112
+#: ../../c-api/typeobj.rst:1154
msgid ""
"This is a bitmask of all the bits that pertain to the existence of certain "
"fields in the type object and its extension structures. Currently, it "
"includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`."
msgstr ""
-#: ../../c-api/typeobj.rst:1123
+#: ../../c-api/typeobj.rst:1165
msgid "This bit indicates that objects behave like unbound methods."
msgstr ""
-#: ../../c-api/typeobj.rst:1125
+#: ../../c-api/typeobj.rst:1167
msgid "If this flag is set for ``type(meth)``, then:"
msgstr ""
-#: ../../c-api/typeobj.rst:1127
+#: ../../c-api/typeobj.rst:1169
msgid ""
"``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be "
"equivalent to ``meth(obj, *args, **kwds)``."
msgstr ""
-#: ../../c-api/typeobj.rst:1130
+#: ../../c-api/typeobj.rst:1172
msgid ""
"``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to "
"``meth(*args, **kwds)``."
msgstr ""
-#: ../../c-api/typeobj.rst:1133
+#: ../../c-api/typeobj.rst:1175
msgid ""
-"This flag enables an optimization for typical method calls like ``obj."
-"meth()``: it avoids creating a temporary \"bound method\" object for ``obj."
-"meth``."
+"This flag enables an optimization for typical method calls like "
+"``obj.meth()``: it avoids creating a temporary \"bound method\" object for "
+"``obj.meth``."
msgstr ""
-#: ../../c-api/typeobj.rst:1141
+#: ../../c-api/typeobj.rst:1183
msgid ""
-"This flag is never inherited by types without the :c:macro:"
-"`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited "
-"whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited."
+"This flag is never inherited by types without "
+"the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it "
+"is inherited whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited."
msgstr ""
-#: ../../c-api/typeobj.rst:1147
+#: ../../c-api/typeobj.rst:1189
msgid ""
"This bit indicates that instances of the class have a `~object.__dict__` "
"attribute, and that the space for the dictionary is managed by the VM."
msgstr ""
-#: ../../c-api/typeobj.rst:1150
+#: ../../c-api/typeobj.rst:1192
msgid "If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set."
msgstr ""
-#: ../../c-api/typeobj.rst:1152
+#: ../../c-api/typeobj.rst:1194
msgid ""
"The type traverse function must call :c:func:`PyObject_VisitManagedDict` and "
"its clear function must call :c:func:`PyObject_ClearManagedDict`."
msgstr ""
-#: ../../c-api/typeobj.rst:1159
+#: ../../c-api/typeobj.rst:1201
msgid ""
"This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` "
"field is set in a superclass."
msgstr ""
-#: ../../c-api/typeobj.rst:1165
+#: ../../c-api/typeobj.rst:1207
msgid ""
"This bit indicates that instances of the class should be weakly "
"referenceable."
msgstr ""
-#: ../../c-api/typeobj.rst:1172
+#: ../../c-api/typeobj.rst:1214
msgid ""
-"This flag is inherited unless the :c:member:`~PyTypeObject."
-"tp_weaklistoffset` field is set in a superclass."
+"This flag is inherited unless "
+"the :c:member:`~PyTypeObject.tp_weaklistoffset` field is set in a superclass."
msgstr ""
-#: ../../c-api/typeobj.rst:1178
+#: ../../c-api/typeobj.rst:1220
msgid ""
-"Only usable with variable-size types, i.e. ones with non-zero :c:member:"
-"`~PyTypeObject.tp_itemsize`."
+"Only usable with variable-size types, i.e. ones with non-"
+"zero :c:member:`~PyTypeObject.tp_itemsize`."
msgstr ""
-#: ../../c-api/typeobj.rst:1181
+#: ../../c-api/typeobj.rst:1223
msgid ""
"Indicates that the variable-sized portion of an instance of this type is at "
"the end of the instance's memory area, at an offset of ``Py_TYPE(obj)-"
">tp_basicsize`` (which may be different in each subclass)."
msgstr ""
-#: ../../c-api/typeobj.rst:1186
+#: ../../c-api/typeobj.rst:1228
msgid ""
"When setting this flag, be sure that all superclasses either use this memory "
"layout, or are not variable-sized. Python does not check this."
msgstr ""
-#: ../../c-api/typeobj.rst:1194
+#: ../../c-api/typeobj.rst:1236
msgid "This flag is inherited."
msgstr ""
-#: ../../c-api/typeobj.rst:1208
+#: ../../c-api/typeobj.rst:1250
msgid ""
"These flags are used by functions such as :c:func:`PyLong_Check` to quickly "
"determine if a type is a subclass of a built-in type; such specific checks "
"are faster than a generic check, like :c:func:`PyObject_IsInstance`. Custom "
-"types that inherit from built-ins should have their :c:member:`~PyTypeObject."
-"tp_flags` set appropriately, or the code that interacts with such types will "
-"behave differently depending on what kind of check is used."
+"types that inherit from built-ins should have "
+"their :c:member:`~PyTypeObject.tp_flags` set appropriately, or the code that "
+"interacts with such types will behave differently depending on what kind of "
+"check is used."
msgstr ""
-#: ../../c-api/typeobj.rst:1219
+#: ../../c-api/typeobj.rst:1261
msgid ""
"This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is "
"present in the type structure."
msgstr ""
-#: ../../c-api/typeobj.rst:1224
+#: ../../c-api/typeobj.rst:1266
msgid ""
-"This flag isn't necessary anymore, as the interpreter assumes the :c:member:"
-"`~PyTypeObject.tp_finalize` slot is always present in the type structure."
+"This flag isn't necessary anymore, as the interpreter assumes "
+"the :c:member:`~PyTypeObject.tp_finalize` slot is always present in the type "
+"structure."
msgstr ""
-#: ../../c-api/typeobj.rst:1232
+#: ../../c-api/typeobj.rst:1274
msgid ""
"This bit is set when the class implements the :ref:`vectorcall protocol "
"`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for "
"details."
msgstr ""
-#: ../../c-api/typeobj.rst:1238
+#: ../../c-api/typeobj.rst:1280
msgid ""
"This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited."
msgstr ""
-#: ../../c-api/typeobj.rst:1245
+#: ../../c-api/typeobj.rst:1287
msgid ""
-"This flag is now removed from a class when the class's :py:meth:`~object."
-"__call__` method is reassigned."
+"This flag is now removed from a class when the "
+"class's :py:meth:`~object.__call__` method is reassigned."
msgstr ""
-#: ../../c-api/typeobj.rst:1248
+#: ../../c-api/typeobj.rst:1290
msgid "This flag can now be inherited by mutable classes."
msgstr ""
-#: ../../c-api/typeobj.rst:1252
+#: ../../c-api/typeobj.rst:1294
msgid ""
"This bit is set for type objects that are immutable: type attributes cannot "
"be set nor deleted."
msgstr ""
-#: ../../c-api/typeobj.rst:1254
+#: ../../c-api/typeobj.rst:1296
msgid ""
":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types "
"`."
msgstr ""
-#: ../../c-api/typeobj.rst:1259
+#: ../../c-api/typeobj.rst:1301
msgid "This flag is not inherited."
msgstr ""
-#: ../../c-api/typeobj.rst:1265
+#: ../../c-api/typeobj.rst:1307
msgid ""
-"Disallow creating instances of the type: set :c:member:`~PyTypeObject."
-"tp_new` to NULL and don't create the ``__new__`` key in the type dictionary."
+"Disallow creating instances of the type: "
+"set :c:member:`~PyTypeObject.tp_new` to NULL and don't create the "
+"``__new__`` key in the type dictionary."
msgstr ""
-#: ../../c-api/typeobj.rst:1269
+#: ../../c-api/typeobj.rst:1311
msgid ""
"The flag must be set before creating the type, not after. For example, it "
"must be set before :c:func:`PyType_Ready` is called on the type."
msgstr ""
-#: ../../c-api/typeobj.rst:1272
+#: ../../c-api/typeobj.rst:1314
msgid ""
-"The flag is set automatically on :ref:`static types ` if :c:"
-"member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:"
-"member:`~PyTypeObject.tp_new` is NULL."
+"The flag is set automatically on :ref:`static types ` "
+"if :c:member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` "
+"and :c:member:`~PyTypeObject.tp_new` is NULL."
msgstr ""
-#: ../../c-api/typeobj.rst:1278
+#: ../../c-api/typeobj.rst:1320
msgid ""
"This flag is not inherited. However, subclasses will not be instantiable "
"unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is "
"only possible via the C API)."
msgstr ""
-#: ../../c-api/typeobj.rst:1285
+#: ../../c-api/typeobj.rst:1327
msgid ""
"To disallow instantiating a class directly but allow instantiating its "
"subclasses (e.g. for an :term:`abstract base class`), do not use this flag. "
"Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses."
msgstr ""
-#: ../../c-api/typeobj.rst:1296
+#: ../../c-api/typeobj.rst:1338
msgid ""
"This bit indicates that instances of the class may match mapping patterns "
"when used as the subject of a :keyword:`match` block. It is automatically "
@@ -2277,23 +2347,23 @@ msgid ""
"unset when registering :class:`collections.abc.Sequence`."
msgstr ""
-#: ../../c-api/typeobj.rst:1303 ../../c-api/typeobj.rst:1325
+#: ../../c-api/typeobj.rst:1345 ../../c-api/typeobj.rst:1367
msgid ""
":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are "
"mutually exclusive; it is an error to enable both flags simultaneously."
msgstr ""
-#: ../../c-api/typeobj.rst:1308
+#: ../../c-api/typeobj.rst:1350
msgid ""
-"This flag is inherited by types that do not already set :c:macro:"
-"`Py_TPFLAGS_SEQUENCE`."
+"This flag is inherited by types that do not already "
+"set :c:macro:`Py_TPFLAGS_SEQUENCE`."
msgstr ""
-#: ../../c-api/typeobj.rst:1311 ../../c-api/typeobj.rst:1333
+#: ../../c-api/typeobj.rst:1353 ../../c-api/typeobj.rst:1375
msgid ":pep:`634` -- Structural Pattern Matching: Specification"
msgstr ""
-#: ../../c-api/typeobj.rst:1318
+#: ../../c-api/typeobj.rst:1360
msgid ""
"This bit indicates that instances of the class may match sequence patterns "
"when used as the subject of a :keyword:`match` block. It is automatically "
@@ -2301,63 +2371,63 @@ msgid ""
"unset when registering :class:`collections.abc.Mapping`."
msgstr ""
-#: ../../c-api/typeobj.rst:1330
+#: ../../c-api/typeobj.rst:1372
msgid ""
-"This flag is inherited by types that do not already set :c:macro:"
-"`Py_TPFLAGS_MAPPING`."
+"This flag is inherited by types that do not already "
+"set :c:macro:`Py_TPFLAGS_MAPPING`."
msgstr ""
-#: ../../c-api/typeobj.rst:1340
+#: ../../c-api/typeobj.rst:1382
msgid ""
"Internal. Do not set or unset this flag. To indicate that a class has "
"changed call :c:func:`PyType_Modified`"
msgstr ""
-#: ../../c-api/typeobj.rst:1344
+#: ../../c-api/typeobj.rst:1386
msgid ""
"This flag is present in header files, but is not be used. It will be removed "
"in a future version of CPython"
msgstr ""
-#: ../../c-api/typeobj.rst:1350
+#: ../../c-api/typeobj.rst:1392
msgid ""
"An optional pointer to a NUL-terminated C string giving the docstring for "
"this type object. This is exposed as the :attr:`~type.__doc__` attribute on "
"the type and instances of the type."
msgstr ""
-#: ../../c-api/typeobj.rst:1356
+#: ../../c-api/typeobj.rst:1398
msgid "This field is *not* inherited by subtypes."
msgstr ""
-#: ../../c-api/typeobj.rst:1361
+#: ../../c-api/typeobj.rst:1403
msgid ""
"An optional pointer to a traversal function for the garbage collector. This "
"is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The "
"signature is::"
msgstr ""
-#: ../../c-api/typeobj.rst:1364
+#: ../../c-api/typeobj.rst:1406
msgid "int tp_traverse(PyObject *self, visitproc visit, void *arg);"
msgstr "int tp_traverse(PyObject *self, visitproc visit, void *arg);"
-#: ../../c-api/typeobj.rst:1366 ../../c-api/typeobj.rst:1510
+#: ../../c-api/typeobj.rst:1408 ../../c-api/typeobj.rst:1552
msgid ""
"More information about Python's garbage collection scheme can be found in "
"section :ref:`supporting-cycle-detection`."
msgstr ""
-#: ../../c-api/typeobj.rst:1369
+#: ../../c-api/typeobj.rst:1411
msgid ""
"The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage "
-"collector to detect reference cycles. A typical implementation of a :c:"
-"member:`~PyTypeObject.tp_traverse` function simply calls :c:func:`Py_VISIT` "
-"on each of the instance's members that are Python objects that the instance "
-"owns. For example, this is function :c:func:`!local_traverse` from the :mod:"
-"`!_thread` extension module::"
+"collector to detect reference cycles. A typical implementation of "
+"a :c:member:`~PyTypeObject.tp_traverse` function simply "
+"calls :c:func:`Py_VISIT` on each of the instance's members that are Python "
+"objects that the instance owns. For example, this is function :c:func:`!"
+"local_traverse` from the :mod:`!_thread` extension module::"
msgstr ""
-#: ../../c-api/typeobj.rst:1375
+#: ../../c-api/typeobj.rst:1417
msgid ""
"static int\n"
"local_traverse(localobject *self, visitproc visit, void *arg)\n"
@@ -2377,7 +2447,7 @@ msgstr ""
" return 0;\n"
"}"
-#: ../../c-api/typeobj.rst:1384
+#: ../../c-api/typeobj.rst:1426
msgid ""
"Note that :c:func:`Py_VISIT` is called only on those members that can "
"participate in reference cycles. Although there is also a ``self->key`` "
@@ -2385,29 +2455,29 @@ msgid ""
"part of a reference cycle."
msgstr ""
-#: ../../c-api/typeobj.rst:1388
+#: ../../c-api/typeobj.rst:1430
msgid ""
"On the other hand, even if you know a member can never be part of a cycle, "
"as a debugging aid you may want to visit it anyway just so the :mod:`gc` "
"module's :func:`~gc.get_referents` function will include it."
msgstr ""
-#: ../../c-api/typeobj.rst:1392
+#: ../../c-api/typeobj.rst:1434
msgid ""
"Heap types (:c:macro:`Py_TPFLAGS_HEAPTYPE`) must visit their type with::"
msgstr ""
-#: ../../c-api/typeobj.rst:1394
+#: ../../c-api/typeobj.rst:1436
msgid "Py_VISIT(Py_TYPE(self));"
msgstr "Py_VISIT(Py_TYPE(self));"
-#: ../../c-api/typeobj.rst:1396
+#: ../../c-api/typeobj.rst:1438
msgid ""
"It is only needed since Python 3.9. To support Python 3.8 and older, this "
"line must be conditional::"
msgstr ""
-#: ../../c-api/typeobj.rst:1399
+#: ../../c-api/typeobj.rst:1441
msgid ""
"#if PY_VERSION_HEX >= 0x03090000\n"
" Py_VISIT(Py_TYPE(self));\n"
@@ -2417,18 +2487,18 @@ msgstr ""
" Py_VISIT(Py_TYPE(self));\n"
"#endif"
-#: ../../c-api/typeobj.rst:1403
+#: ../../c-api/typeobj.rst:1445
msgid ""
-"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:"
-"`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:"
-"`PyObject_VisitManagedDict` like this::"
+"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in "
+"the :c:member:`~PyTypeObject.tp_flags` field, the traverse function must "
+"call :c:func:`PyObject_VisitManagedDict` like this::"
msgstr ""
-#: ../../c-api/typeobj.rst:1407
+#: ../../c-api/typeobj.rst:1449
msgid "PyObject_VisitManagedDict((PyObject*)self, visit, arg);"
msgstr "PyObject_VisitManagedDict((PyObject*)self, visit, arg);"
-#: ../../c-api/typeobj.rst:1410
+#: ../../c-api/typeobj.rst:1452
msgid ""
"When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members "
"that the instance *owns* (by having :term:`strong references ` hold a reference to "
-"their type. Their traversal function must therefore either visit :c:func:"
-"`Py_TYPE(self) `, or delegate this responsibility by calling "
-"``tp_traverse`` of another heap-allocated type (such as a heap-allocated "
-"superclass). If they do not, the type object may not be garbage-collected."
+"their type. Their traversal function must therefore either "
+"visit :c:func:`Py_TYPE(self) `, or delegate this responsibility by "
+"calling ``tp_traverse`` of another heap-allocated type (such as a heap-"
+"allocated superclass). If they do not, the type object may not be garbage-"
+"collected."
msgstr ""
-#: ../../c-api/typeobj.rst:1434
+#: ../../c-api/typeobj.rst:1476
msgid ""
"Heap-allocated types are expected to visit ``Py_TYPE(self)`` in "
"``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses."
msgstr ""
-#: ../../c-api/typeobj.rst:1443
+#: ../../c-api/typeobj.rst:1485
msgid ""
-"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
-"tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:"
-"member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` "
-"are all inherited from the base type if they are all zero in the subtype."
+"This field is inherited by subtypes together "
+"with :c:member:`~PyTypeObject.tp_clear` and "
+"the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag "
+"bit, :c:member:`~PyTypeObject.tp_traverse`, "
+"and :c:member:`~PyTypeObject.tp_clear` are all inherited from the base type "
+"if they are all zero in the subtype."
msgstr ""
-#: ../../c-api/typeobj.rst:1451
+#: ../../c-api/typeobj.rst:1493
msgid ""
"An optional pointer to a clear function for the garbage collector. This is "
"only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The "
"signature is::"
msgstr ""
-#: ../../c-api/typeobj.rst:1454
+#: ../../c-api/typeobj.rst:1496
msgid "int tp_clear(PyObject *);"
msgstr "int tp_clear(PyObject *);"
-#: ../../c-api/typeobj.rst:1456
+#: ../../c-api/typeobj.rst:1498
msgid ""
"The :c:member:`~PyTypeObject.tp_clear` member function is used to break "
"reference cycles in cyclic garbage detected by the garbage collector. Taken "
@@ -2492,13 +2565,14 @@ msgid ""
"doubt supply a :c:member:`~PyTypeObject.tp_clear` function. For example, "
"the tuple type does not implement a :c:member:`~PyTypeObject.tp_clear` "
"function, because it's possible to prove that no reference cycle can be "
-"composed entirely of tuples. Therefore the :c:member:`~PyTypeObject."
-"tp_clear` functions of other types must be sufficient to break any cycle "
-"containing a tuple. This isn't immediately obvious, and there's rarely a "
-"good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`."
+"composed entirely of tuples. Therefore "
+"the :c:member:`~PyTypeObject.tp_clear` functions of other types must be "
+"sufficient to break any cycle containing a tuple. This isn't immediately "
+"obvious, and there's rarely a good reason to avoid "
+"implementing :c:member:`~PyTypeObject.tp_clear`."
msgstr ""
-#: ../../c-api/typeobj.rst:1466
+#: ../../c-api/typeobj.rst:1508
msgid ""
"Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the "
"instance's references to those of its members that may be Python objects, "
@@ -2506,7 +2580,7 @@ msgid ""
"example::"
msgstr ""
-#: ../../c-api/typeobj.rst:1470
+#: ../../c-api/typeobj.rst:1512
msgid ""
"static int\n"
"local_clear(localobject *self)\n"
@@ -2528,12 +2602,12 @@ msgstr ""
" return 0;\n"
"}"
-#: ../../c-api/typeobj.rst:1480
+#: ../../c-api/typeobj.rst:1522
msgid ""
"The :c:func:`Py_CLEAR` macro should be used, because clearing references is "
-"delicate: the reference to the contained object must not be released (via :"
-"c:func:`Py_DECREF`) until after the pointer to the contained object is set "
-"to ``NULL``. This is because releasing the reference may cause the "
+"delicate: the reference to the contained object must not be released "
+"(via :c:func:`Py_DECREF`) until after the pointer to the contained object is "
+"set to ``NULL``. This is because releasing the reference may cause the "
"contained object to become trash, triggering a chain of reclamation activity "
"that may include invoking arbitrary Python code (due to finalizers, or "
"weakref callbacks, associated with the contained object). If it's possible "
@@ -2543,18 +2617,18 @@ msgid ""
"performs the operations in a safe order."
msgstr ""
-#: ../../c-api/typeobj.rst:1492
+#: ../../c-api/typeobj.rst:1534
msgid ""
-"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:"
-"`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:"
-"`PyObject_ClearManagedDict` like this::"
+"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in "
+"the :c:member:`~PyTypeObject.tp_flags` field, the traverse function must "
+"call :c:func:`PyObject_ClearManagedDict` like this::"
msgstr ""
-#: ../../c-api/typeobj.rst:1496
+#: ../../c-api/typeobj.rst:1538
msgid "PyObject_ClearManagedDict((PyObject*)self);"
msgstr "PyObject_ClearManagedDict((PyObject*)self);"
-#: ../../c-api/typeobj.rst:1498
+#: ../../c-api/typeobj.rst:1540
msgid ""
"Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before "
"an instance is deallocated. For example, when reference counting is enough "
@@ -2562,7 +2636,7 @@ msgid ""
"is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly."
msgstr ""
-#: ../../c-api/typeobj.rst:1504
+#: ../../c-api/typeobj.rst:1546
msgid ""
"Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break "
"reference cycles, it's not necessary to clear contained objects like Python "
@@ -2572,30 +2646,32 @@ msgid ""
"invoke :c:member:`~PyTypeObject.tp_clear`."
msgstr ""
-#: ../../c-api/typeobj.rst:1517
+#: ../../c-api/typeobj.rst:1559
msgid ""
-"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
-"tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :"
-"c:member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` "
-"are all inherited from the base type if they are all zero in the subtype."
+"This field is inherited by subtypes together "
+"with :c:member:`~PyTypeObject.tp_traverse` and "
+"the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag "
+"bit, :c:member:`~PyTypeObject.tp_traverse`, "
+"and :c:member:`~PyTypeObject.tp_clear` are all inherited from the base type "
+"if they are all zero in the subtype."
msgstr ""
-#: ../../c-api/typeobj.rst:1525
+#: ../../c-api/typeobj.rst:1567
msgid ""
"An optional pointer to the rich comparison function, whose signature is::"
msgstr ""
-#: ../../c-api/typeobj.rst:1527
+#: ../../c-api/typeobj.rst:1569
msgid "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);"
msgstr "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);"
-#: ../../c-api/typeobj.rst:1529
+#: ../../c-api/typeobj.rst:1571
msgid ""
"The first parameter is guaranteed to be an instance of the type that is "
"defined by :c:type:`PyTypeObject`."
msgstr ""
-#: ../../c-api/typeobj.rst:1532
+#: ../../c-api/typeobj.rst:1574
msgid ""
"The function should return the result of the comparison (usually ``Py_True`` "
"or ``Py_False``). If the comparison is undefined, it must return "
@@ -2603,50 +2679,51 @@ msgid ""
"set an exception condition."
msgstr ""
-#: ../../c-api/typeobj.rst:1537
+#: ../../c-api/typeobj.rst:1579
msgid ""
-"The following constants are defined to be used as the third argument for :c:"
-"member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:"
+"The following constants are defined to be used as the third argument "
+"for :c:member:`~PyTypeObject.tp_richcompare` and "
+"for :c:func:`PyObject_RichCompare`:"
msgstr ""
-#: ../../c-api/typeobj.rst:1543
+#: ../../c-api/typeobj.rst:1585
msgid "Constant"
msgstr "常數"
-#: ../../c-api/typeobj.rst:1543
+#: ../../c-api/typeobj.rst:1585
msgid "Comparison"
msgstr ""
-#: ../../c-api/typeobj.rst:1545
+#: ../../c-api/typeobj.rst:1587
msgid "``<``"
msgstr "``<``"
-#: ../../c-api/typeobj.rst:1547
+#: ../../c-api/typeobj.rst:1589
msgid "``<=``"
msgstr "``<=``"
-#: ../../c-api/typeobj.rst:1549
+#: ../../c-api/typeobj.rst:1591
msgid "``==``"
msgstr "``==``"
-#: ../../c-api/typeobj.rst:1551
+#: ../../c-api/typeobj.rst:1593
msgid "``!=``"
msgstr "``!=``"
-#: ../../c-api/typeobj.rst:1553
+#: ../../c-api/typeobj.rst:1595
msgid "``>``"
msgstr "``>``"
-#: ../../c-api/typeobj.rst:1555
+#: ../../c-api/typeobj.rst:1597
msgid "``>=``"
msgstr "``>=``"
-#: ../../c-api/typeobj.rst:1558
+#: ../../c-api/typeobj.rst:1600
msgid ""
"The following macro is defined to ease writing rich comparison functions:"
msgstr ""
-#: ../../c-api/typeobj.rst:1562
+#: ../../c-api/typeobj.rst:1604
msgid ""
"Return ``Py_True`` or ``Py_False`` from the function, depending on the "
"result of a comparison. VAL_A and VAL_B must be orderable by C comparison "
@@ -2654,60 +2731,62 @@ msgid ""
"specifies the requested operation, as for :c:func:`PyObject_RichCompare`."
msgstr ""
-#: ../../c-api/typeobj.rst:1568
+#: ../../c-api/typeobj.rst:1610
msgid "The returned value is a new :term:`strong reference`."
msgstr ""
-#: ../../c-api/typeobj.rst:1570
+#: ../../c-api/typeobj.rst:1612
msgid "On error, sets an exception and returns ``NULL`` from the function."
msgstr ""
-#: ../../c-api/typeobj.rst:1578
+#: ../../c-api/typeobj.rst:1620
msgid ""
-"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
-"tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:"
-"member:`~PyTypeObject.tp_hash` when the subtype's :c:member:`~PyTypeObject."
-"tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``."
+"This field is inherited by subtypes together "
+"with :c:member:`~PyTypeObject.tp_hash`: a subtype "
+"inherits :c:member:`~PyTypeObject.tp_richcompare` "
+"and :c:member:`~PyTypeObject.tp_hash` when the "
+"subtype's :c:member:`~PyTypeObject.tp_richcompare` "
+"and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``."
msgstr ""
-#: ../../c-api/typeobj.rst:1585
+#: ../../c-api/typeobj.rst:1627
msgid ""
-":c:data:`PyBaseObject_Type` provides a :c:member:`~PyTypeObject."
-"tp_richcompare` implementation, which may be inherited. However, if only :c:"
-"member:`~PyTypeObject.tp_hash` is defined, not even the inherited function "
-"is used and instances of the type will not be able to participate in any "
-"comparisons."
+":c:data:`PyBaseObject_Type` provides "
+"a :c:member:`~PyTypeObject.tp_richcompare` implementation, which may be "
+"inherited. However, if only :c:member:`~PyTypeObject.tp_hash` is defined, "
+"not even the inherited function is used and instances of the type will not "
+"be able to participate in any comparisons."
msgstr ""
-#: ../../c-api/typeobj.rst:1594
+#: ../../c-api/typeobj.rst:1636
msgid ""
"While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` "
"should be used instead, if at all possible."
msgstr ""
-#: ../../c-api/typeobj.rst:1597
+#: ../../c-api/typeobj.rst:1639
msgid ""
"If the instances of this type are weakly referenceable, this field is "
"greater than zero and contains the offset in the instance structure of the "
"weak reference list head (ignoring the GC header, if present); this offset "
"is used by :c:func:`PyObject_ClearWeakRefs` and the ``PyWeakref_*`` "
-"functions. The instance structure needs to include a field of type :c:expr:"
-"`PyObject*` which is initialized to ``NULL``."
+"functions. The instance structure needs to include a field of "
+"type :c:expr:`PyObject*` which is initialized to ``NULL``."
msgstr ""
-#: ../../c-api/typeobj.rst:1604
+#: ../../c-api/typeobj.rst:1646
msgid ""
"Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that "
"is the list head for weak references to the type object itself."
msgstr ""
-#: ../../c-api/typeobj.rst:1607
+#: ../../c-api/typeobj.rst:1649
msgid ""
"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit "
"and :c:member:`~PyTypeObject.tp_weaklistoffset`."
msgstr ""
-#: ../../c-api/typeobj.rst:1612
+#: ../../c-api/typeobj.rst:1654
msgid ""
"This field is inherited by subtypes, but see the rules listed below. A "
"subtype may override this offset; this means that the subtype uses a "
@@ -2716,115 +2795,116 @@ msgid ""
"not be a problem."
msgstr ""
-#: ../../c-api/typeobj.rst:1619
+#: ../../c-api/typeobj.rst:1661
msgid ""
-"If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:"
-"`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject."
-"tp_weaklistoffset` will be set to a negative value, to indicate that it is "
-"unsafe to use this field."
+"If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in "
+"the :c:member:`~PyTypeObject.tp_flags` field, "
+"then :c:member:`~PyTypeObject.tp_weaklistoffset` will be set to a negative "
+"value, to indicate that it is unsafe to use this field."
msgstr ""
-#: ../../c-api/typeobj.rst:1627
+#: ../../c-api/typeobj.rst:1669
msgid ""
"An optional pointer to a function that returns an :term:`iterator` for the "
-"object. Its presence normally signals that the instances of this type are :"
-"term:`iterable` (although sequences may be iterable without this function)."
+"object. Its presence normally signals that the instances of this type "
+"are :term:`iterable` (although sequences may be iterable without this "
+"function)."
msgstr ""
-#: ../../c-api/typeobj.rst:1631
+#: ../../c-api/typeobj.rst:1673
msgid "This function has the same signature as :c:func:`PyObject_GetIter`::"
msgstr ""
-#: ../../c-api/typeobj.rst:1633
+#: ../../c-api/typeobj.rst:1675
msgid "PyObject *tp_iter(PyObject *self);"
msgstr "PyObject *tp_iter(PyObject *self);"
-#: ../../c-api/typeobj.rst:1642
+#: ../../c-api/typeobj.rst:1684
msgid ""
-"An optional pointer to a function that returns the next item in an :term:"
-"`iterator`. The signature is::"
+"An optional pointer to a function that returns the next item in "
+"an :term:`iterator`. The signature is::"
msgstr ""
-#: ../../c-api/typeobj.rst:1645
+#: ../../c-api/typeobj.rst:1687
msgid "PyObject *tp_iternext(PyObject *self);"
msgstr "PyObject *tp_iternext(PyObject *self);"
-#: ../../c-api/typeobj.rst:1647
+#: ../../c-api/typeobj.rst:1689
msgid ""
-"When the iterator is exhausted, it must return ``NULL``; a :exc:"
-"`StopIteration` exception may or may not be set. When another error occurs, "
-"it must return ``NULL`` too. Its presence signals that the instances of "
-"this type are iterators."
+"When the iterator is exhausted, it must return ``NULL``; "
+"a :exc:`StopIteration` exception may or may not be set. When another error "
+"occurs, it must return ``NULL`` too. Its presence signals that the "
+"instances of this type are iterators."
msgstr ""
-#: ../../c-api/typeobj.rst:1652
+#: ../../c-api/typeobj.rst:1694
msgid ""
"Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` "
"function, and that function should return the iterator instance itself (not "
"a new iterator instance)."
msgstr ""
-#: ../../c-api/typeobj.rst:1656
+#: ../../c-api/typeobj.rst:1698
msgid "This function has the same signature as :c:func:`PyIter_Next`."
msgstr ""
-#: ../../c-api/typeobj.rst:1665
+#: ../../c-api/typeobj.rst:1707
msgid ""
-"An optional pointer to a static ``NULL``-terminated array of :c:type:"
-"`PyMethodDef` structures, declaring regular methods of this type."
+"An optional pointer to a static ``NULL``-terminated array "
+"of :c:type:`PyMethodDef` structures, declaring regular methods of this type."
msgstr ""
-#: ../../c-api/typeobj.rst:1668
+#: ../../c-api/typeobj.rst:1710
msgid ""
"For each entry in the array, an entry is added to the type's dictionary "
"(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor."
msgstr ""
-#: ../../c-api/typeobj.rst:1673
+#: ../../c-api/typeobj.rst:1715
msgid ""
"This field is not inherited by subtypes (methods are inherited through a "
"different mechanism)."
msgstr ""
-#: ../../c-api/typeobj.rst:1679
+#: ../../c-api/typeobj.rst:1721
msgid ""
-"An optional pointer to a static ``NULL``-terminated array of :c:type:"
-"`PyMemberDef` structures, declaring regular data members (fields or slots) "
-"of instances of this type."
+"An optional pointer to a static ``NULL``-terminated array "
+"of :c:type:`PyMemberDef` structures, declaring regular data members (fields "
+"or slots) of instances of this type."
msgstr ""
-#: ../../c-api/typeobj.rst:1683
+#: ../../c-api/typeobj.rst:1725
msgid ""
"For each entry in the array, an entry is added to the type's dictionary "
"(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor."
msgstr ""
-#: ../../c-api/typeobj.rst:1688
+#: ../../c-api/typeobj.rst:1730
msgid ""
"This field is not inherited by subtypes (members are inherited through a "
"different mechanism)."
msgstr ""
-#: ../../c-api/typeobj.rst:1694
+#: ../../c-api/typeobj.rst:1736
msgid ""
-"An optional pointer to a static ``NULL``-terminated array of :c:type:"
-"`PyGetSetDef` structures, declaring computed attributes of instances of this "
-"type."
+"An optional pointer to a static ``NULL``-terminated array "
+"of :c:type:`PyGetSetDef` structures, declaring computed attributes of "
+"instances of this type."
msgstr ""
-#: ../../c-api/typeobj.rst:1697
+#: ../../c-api/typeobj.rst:1739
msgid ""
"For each entry in the array, an entry is added to the type's dictionary "
"(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor."
msgstr ""
-#: ../../c-api/typeobj.rst:1702
+#: ../../c-api/typeobj.rst:1744
msgid ""
"This field is not inherited by subtypes (computed attributes are inherited "
"through a different mechanism)."
msgstr ""
-#: ../../c-api/typeobj.rst:1708
+#: ../../c-api/typeobj.rst:1750
msgid ""
"An optional pointer to a base type from which type properties are "
"inherited. At this level, only single inheritance is supported; multiple "
@@ -2832,7 +2912,7 @@ msgid ""
"metatype."
msgstr ""
-#: ../../c-api/typeobj.rst:1716
+#: ../../c-api/typeobj.rst:1758
msgid ""
"Slot initialization is subject to the rules of initializing globals. C99 "
"requires the initializers to be \"address constants\". Function designators "
@@ -2840,173 +2920,176 @@ msgid ""
"valid C99 address constants."
msgstr ""
-#: ../../c-api/typeobj.rst:1721
+#: ../../c-api/typeobj.rst:1763
msgid ""
-"However, the unary '&' operator applied to a non-static variable like :c:"
-"data:`PyBaseObject_Type` is not required to produce an address constant. "
-"Compilers may support this (gcc does), MSVC does not. Both compilers are "
-"strictly standard conforming in this particular behavior."
+"However, the unary '&' operator applied to a non-static variable "
+"like :c:data:`PyBaseObject_Type` is not required to produce an address "
+"constant. Compilers may support this (gcc does), MSVC does not. Both "
+"compilers are strictly standard conforming in this particular behavior."
msgstr ""
-#: ../../c-api/typeobj.rst:1727
+#: ../../c-api/typeobj.rst:1769
msgid ""
"Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the "
"extension module's init function."
msgstr ""
-#: ../../c-api/typeobj.rst:1732
+#: ../../c-api/typeobj.rst:1774
msgid "This field is not inherited by subtypes (obviously)."
msgstr ""
-#: ../../c-api/typeobj.rst:1736
+#: ../../c-api/typeobj.rst:1778
msgid ""
"This field defaults to ``&PyBaseObject_Type`` (which to Python programmers "
"is known as the type :class:`object`)."
msgstr ""
-#: ../../c-api/typeobj.rst:1742
+#: ../../c-api/typeobj.rst:1784
msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`."
msgstr ""
-#: ../../c-api/typeobj.rst:1744
+#: ../../c-api/typeobj.rst:1786
msgid ""
"This field should normally be initialized to ``NULL`` before PyType_Ready is "
"called; it may also be initialized to a dictionary containing initial "
"attributes for the type. Once :c:func:`PyType_Ready` has initialized the "
"type, extra attributes for the type may be added to this dictionary only if "
-"they don't correspond to overloaded operations (like :meth:`~object."
-"__add__`). Once initialization for the type has finished, this field should "
-"be treated as read-only."
+"they don't correspond to overloaded operations "
+"(like :meth:`~object.__add__`). Once initialization for the type has "
+"finished, this field should be treated as read-only."
msgstr ""
-#: ../../c-api/typeobj.rst:1752
+#: ../../c-api/typeobj.rst:1794
msgid ""
-"Some types may not store their dictionary in this slot. Use :c:func:"
-"`PyType_GetDict` to retrieve the dictionary for an arbitrary type."
+"Some types may not store their dictionary in this slot. "
+"Use :c:func:`PyType_GetDict` to retrieve the dictionary for an arbitrary "
+"type."
msgstr ""
-#: ../../c-api/typeobj.rst:1758
+#: ../../c-api/typeobj.rst:1800
msgid ""
"Internals detail: For static builtin types, this is always ``NULL``. "
-"Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:"
-"func:`PyType_GetDict` to get the dict for an arbitrary type."
+"Instead, the dict for such types is stored on ``PyInterpreterState``. "
+"Use :c:func:`PyType_GetDict` to get the dict for an arbitrary type."
msgstr ""
-#: ../../c-api/typeobj.rst:1764
+#: ../../c-api/typeobj.rst:1806
msgid ""
"This field is not inherited by subtypes (though the attributes defined in "
"here are inherited through a different mechanism)."
msgstr ""
-#: ../../c-api/typeobj.rst:1769
+#: ../../c-api/typeobj.rst:1811
msgid ""
"If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new "
"dictionary to it."
msgstr ""
-#: ../../c-api/typeobj.rst:1774
+#: ../../c-api/typeobj.rst:1816
msgid ""
-"It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:"
-"member:`~PyTypeObject.tp_dict` with the dictionary C-API."
+"It is not safe to use :c:func:`PyDict_SetItem` on or otherwise "
+"modify :c:member:`~PyTypeObject.tp_dict` with the dictionary C-API."
msgstr ""
-#: ../../c-api/typeobj.rst:1780
+#: ../../c-api/typeobj.rst:1822
msgid "An optional pointer to a \"descriptor get\" function."
msgstr ""
-#: ../../c-api/typeobj.rst:1782 ../../c-api/typeobj.rst:1798
-#: ../../c-api/typeobj.rst:1862 ../../c-api/typeobj.rst:1892
-#: ../../c-api/typeobj.rst:1916
+#: ../../c-api/typeobj.rst:1824 ../../c-api/typeobj.rst:1840
+#: ../../c-api/typeobj.rst:1904 ../../c-api/typeobj.rst:1934
+#: ../../c-api/typeobj.rst:1958
msgid "The function signature is::"
msgstr ""
-#: ../../c-api/typeobj.rst:1784
+#: ../../c-api/typeobj.rst:1826
msgid "PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);"
msgstr ""
"PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);"
-#: ../../c-api/typeobj.rst:1795
+#: ../../c-api/typeobj.rst:1837
msgid ""
"An optional pointer to a function for setting and deleting a descriptor's "
"value."
msgstr ""
-#: ../../c-api/typeobj.rst:1800
+#: ../../c-api/typeobj.rst:1842
msgid "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);"
msgstr "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);"
-#: ../../c-api/typeobj.rst:1802
+#: ../../c-api/typeobj.rst:1844
msgid "The *value* argument is set to ``NULL`` to delete the value."
msgstr ""
-#: ../../c-api/typeobj.rst:1813
+#: ../../c-api/typeobj.rst:1855
msgid ""
"While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` "
"should be used instead, if at all possible."
msgstr ""
-#: ../../c-api/typeobj.rst:1816
+#: ../../c-api/typeobj.rst:1858
msgid ""
"If the instances of this type have a dictionary containing instance "
"variables, this field is non-zero and contains the offset in the instances "
-"of the type of the instance variable dictionary; this offset is used by :c:"
-"func:`PyObject_GenericGetAttr`."
+"of the type of the instance variable dictionary; this offset is used "
+"by :c:func:`PyObject_GenericGetAttr`."
msgstr ""
-#: ../../c-api/typeobj.rst:1821
+#: ../../c-api/typeobj.rst:1863
msgid ""
"Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is "
"the dictionary for attributes of the type object itself."
msgstr ""
-#: ../../c-api/typeobj.rst:1824
+#: ../../c-api/typeobj.rst:1866
msgid ""
"The value specifies the offset of the dictionary from the start of the "
"instance structure."
msgstr ""
-#: ../../c-api/typeobj.rst:1826
+#: ../../c-api/typeobj.rst:1868
msgid ""
"The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-"
-"only. To get the pointer to the dictionary call :c:func:"
-"`PyObject_GenericGetDict`. Calling :c:func:`PyObject_GenericGetDict` may "
-"need to allocate memory for the dictionary, so it is may be more efficient "
-"to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object."
+"only. To get the pointer to the dictionary "
+"call :c:func:`PyObject_GenericGetDict`. "
+"Calling :c:func:`PyObject_GenericGetDict` may need to allocate memory for "
+"the dictionary, so it is may be more efficient to "
+"call :c:func:`PyObject_GetAttr` when accessing an attribute on the object."
msgstr ""
-#: ../../c-api/typeobj.rst:1832
+#: ../../c-api/typeobj.rst:1874
msgid ""
-"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit "
+"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit "
"and :c:member:`~PyTypeObject.tp_dictoffset`."
msgstr ""
-#: ../../c-api/typeobj.rst:1837
+#: ../../c-api/typeobj.rst:1879
msgid ""
"This field is inherited by subtypes. A subtype should not override this "
"offset; doing so could be unsafe, if C code tries to access the dictionary "
-"at the previous offset. To properly support inheritance, use :c:macro:"
-"`Py_TPFLAGS_MANAGED_DICT`."
+"at the previous offset. To properly support inheritance, "
+"use :c:macro:`Py_TPFLAGS_MANAGED_DICT`."
msgstr ""
-#: ../../c-api/typeobj.rst:1844
+#: ../../c-api/typeobj.rst:1886
msgid ""
"This slot has no default. For :ref:`static types `, if the "
"field is ``NULL`` then no :attr:`~object.__dict__` gets created for "
"instances."
msgstr ""
-#: ../../c-api/typeobj.rst:1847
+#: ../../c-api/typeobj.rst:1889
msgid ""
-"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:"
-"`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject.tp_dictoffset` "
-"will be set to ``-1``, to indicate that it is unsafe to use this field."
+"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in "
+"the :c:member:`~PyTypeObject.tp_flags` field, "
+"then :c:member:`~PyTypeObject.tp_dictoffset` will be set to ``-1``, to "
+"indicate that it is unsafe to use this field."
msgstr ""
-#: ../../c-api/typeobj.rst:1855
+#: ../../c-api/typeobj.rst:1897
msgid "An optional pointer to an instance initialization function."
msgstr ""
-#: ../../c-api/typeobj.rst:1857
+#: ../../c-api/typeobj.rst:1899
msgid ""
"This function corresponds to the :meth:`~object.__init__` method of "
"classes. Like :meth:`!__init__`, it is possible to create an instance "
@@ -3014,110 +3097,112 @@ msgid ""
"instance by calling its :meth:`!__init__` method again."
msgstr ""
-#: ../../c-api/typeobj.rst:1864
+#: ../../c-api/typeobj.rst:1906
msgid "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);"
msgstr "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);"
-#: ../../c-api/typeobj.rst:1866
+#: ../../c-api/typeobj.rst:1908
msgid ""
"The self argument is the instance to be initialized; the *args* and *kwds* "
-"arguments represent positional and keyword arguments of the call to :meth:"
-"`~object.__init__`."
+"arguments represent positional and keyword arguments of the call "
+"to :meth:`~object.__init__`."
msgstr ""
-#: ../../c-api/typeobj.rst:1870
+#: ../../c-api/typeobj.rst:1912
msgid ""
"The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called "
-"when an instance is created normally by calling its type, after the type's :"
-"c:member:`~PyTypeObject.tp_new` function has returned an instance of the "
-"type. If the :c:member:`~PyTypeObject.tp_new` function returns an instance "
-"of some other type that is not a subtype of the original type, no :c:member:"
-"`~PyTypeObject.tp_init` function is called; if :c:member:`~PyTypeObject."
-"tp_new` returns an instance of a subtype of the original type, the "
-"subtype's :c:member:`~PyTypeObject.tp_init` is called."
+"when an instance is created normally by calling its type, after the "
+"type's :c:member:`~PyTypeObject.tp_new` function has returned an instance of "
+"the type. If the :c:member:`~PyTypeObject.tp_new` function returns an "
+"instance of some other type that is not a subtype of the original type, "
+"no :c:member:`~PyTypeObject.tp_init` function is called; "
+"if :c:member:`~PyTypeObject.tp_new` returns an instance of a subtype of the "
+"original type, the subtype's :c:member:`~PyTypeObject.tp_init` is called."
msgstr ""
-#: ../../c-api/typeobj.rst:1877
+#: ../../c-api/typeobj.rst:1919
msgid "Returns ``0`` on success, ``-1`` and sets an exception on error."
msgstr ""
-#: ../../c-api/typeobj.rst:1885
+#: ../../c-api/typeobj.rst:1927
msgid ""
"For :ref:`static types ` this field does not have a default."
msgstr ""
-#: ../../c-api/typeobj.rst:1890
+#: ../../c-api/typeobj.rst:1932
msgid "An optional pointer to an instance allocation function."
msgstr ""
-#: ../../c-api/typeobj.rst:1894
+#: ../../c-api/typeobj.rst:1936
msgid "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);"
msgstr "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);"
-#: ../../c-api/typeobj.rst:1898
+#: ../../c-api/typeobj.rst:1940
msgid ""
"This field is inherited by static subtypes, but not by dynamic subtypes "
"(subtypes created by a class statement)."
msgstr ""
-#: ../../c-api/typeobj.rst:1903
+#: ../../c-api/typeobj.rst:1945
msgid ""
-"For dynamic subtypes, this field is always set to :c:func:"
-"`PyType_GenericAlloc`, to force a standard heap allocation strategy."
+"For dynamic subtypes, this field is always set "
+"to :c:func:`PyType_GenericAlloc`, to force a standard heap allocation "
+"strategy."
msgstr ""
-#: ../../c-api/typeobj.rst:1907
+#: ../../c-api/typeobj.rst:1949
msgid ""
-"For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:"
-"`PyType_GenericAlloc`. That is the recommended value for all statically "
-"defined types."
+"For static subtypes, :c:data:`PyBaseObject_Type` "
+"uses :c:func:`PyType_GenericAlloc`. That is the recommended value for all "
+"statically defined types."
msgstr ""
-#: ../../c-api/typeobj.rst:1914
+#: ../../c-api/typeobj.rst:1956
msgid "An optional pointer to an instance creation function."
msgstr ""
-#: ../../c-api/typeobj.rst:1918
+#: ../../c-api/typeobj.rst:1960
msgid ""
"PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);"
msgstr ""
"PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);"
-#: ../../c-api/typeobj.rst:1920
+#: ../../c-api/typeobj.rst:1962
msgid ""
"The *subtype* argument is the type of the object being created; the *args* "
"and *kwds* arguments represent positional and keyword arguments of the call "
-"to the type. Note that *subtype* doesn't have to equal the type whose :c:"
-"member:`~PyTypeObject.tp_new` function is called; it may be a subtype of "
-"that type (but not an unrelated type)."
+"to the type. Note that *subtype* doesn't have to equal the type "
+"whose :c:member:`~PyTypeObject.tp_new` function is called; it may be a "
+"subtype of that type (but not an unrelated type)."
msgstr ""
-#: ../../c-api/typeobj.rst:1926
+#: ../../c-api/typeobj.rst:1968
msgid ""
"The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-"
">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do "
"only as much further initialization as is absolutely necessary. "
"Initialization that can safely be ignored or repeated should be placed in "
"the :c:member:`~PyTypeObject.tp_init` handler. A good rule of thumb is that "
-"for immutable types, all initialization should take place in :c:member:"
-"`~PyTypeObject.tp_new`, while for mutable types, most initialization should "
-"be deferred to :c:member:`~PyTypeObject.tp_init`."
+"for immutable types, all initialization should take place "
+"in :c:member:`~PyTypeObject.tp_new`, while for mutable types, most "
+"initialization should be deferred to :c:member:`~PyTypeObject.tp_init`."
msgstr ""
-#: ../../c-api/typeobj.rst:1934
+#: ../../c-api/typeobj.rst:1976
msgid ""
"Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow "
"creating instances of the type in Python."
msgstr ""
-#: ../../c-api/typeobj.rst:1939
+#: ../../c-api/typeobj.rst:1981
msgid ""
-"This field is inherited by subtypes, except it is not inherited by :ref:"
-"`static types ` whose :c:member:`~PyTypeObject.tp_base` is "
-"``NULL`` or ``&PyBaseObject_Type``."
+"This field is inherited by subtypes, except it is not inherited "
+"by :ref:`static types ` "
+"whose :c:member:`~PyTypeObject.tp_base` is ``NULL`` or "
+"``&PyBaseObject_Type``."
msgstr ""
-#: ../../c-api/typeobj.rst:1945
+#: ../../c-api/typeobj.rst:1987
msgid ""
"For :ref:`static types ` this field has no default. This means "
"if the slot is defined as ``NULL``, the type cannot be called to create new "
@@ -3125,142 +3210,142 @@ msgid ""
"factory function."
msgstr ""
-#: ../../c-api/typeobj.rst:1953
+#: ../../c-api/typeobj.rst:1995
msgid ""
"An optional pointer to an instance deallocation function. Its signature is::"
msgstr ""
-#: ../../c-api/typeobj.rst:1955
+#: ../../c-api/typeobj.rst:1997
msgid "void tp_free(void *self);"
msgstr "void tp_free(void *self);"
-#: ../../c-api/typeobj.rst:1957
+#: ../../c-api/typeobj.rst:1999
msgid ""
-"An initializer that is compatible with this signature is :c:func:"
-"`PyObject_Free`."
+"An initializer that is compatible with this signature "
+"is :c:func:`PyObject_Free`."
msgstr ""
-#: ../../c-api/typeobj.rst:1961
+#: ../../c-api/typeobj.rst:2003
msgid ""
"This field is inherited by static subtypes, but not by dynamic subtypes "
"(subtypes created by a class statement)"
msgstr ""
-#: ../../c-api/typeobj.rst:1966
+#: ../../c-api/typeobj.rst:2008
msgid ""
-"In dynamic subtypes, this field is set to a deallocator suitable to match :c:"
-"func:`PyType_GenericAlloc` and the value of the :c:macro:"
-"`Py_TPFLAGS_HAVE_GC` flag bit."
+"In dynamic subtypes, this field is set to a deallocator suitable to "
+"match :c:func:`PyType_GenericAlloc` and the value of "
+"the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit."
msgstr ""
-#: ../../c-api/typeobj.rst:1970
+#: ../../c-api/typeobj.rst:2012
msgid ""
"For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:`PyObject_Del`."
msgstr ""
-#: ../../c-api/typeobj.rst:1975
+#: ../../c-api/typeobj.rst:2017
msgid "An optional pointer to a function called by the garbage collector."
msgstr ""
-#: ../../c-api/typeobj.rst:1977
+#: ../../c-api/typeobj.rst:2019
msgid ""
"The garbage collector needs to know whether a particular object is "
"collectible or not. Normally, it is sufficient to look at the object's "
-"type's :c:member:`~PyTypeObject.tp_flags` field, and check the :c:macro:"
-"`Py_TPFLAGS_HAVE_GC` flag bit. But some types have a mixture of statically "
-"and dynamically allocated instances, and the statically allocated instances "
-"are not collectible. Such types should define this function; it should "
-"return ``1`` for a collectible instance, and ``0`` for a non-collectible "
-"instance. The signature is::"
+"type's :c:member:`~PyTypeObject.tp_flags` field, and check "
+"the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit. But some types have a mixture "
+"of statically and dynamically allocated instances, and the statically "
+"allocated instances are not collectible. Such types should define this "
+"function; it should return ``1`` for a collectible instance, and ``0`` for a "
+"non-collectible instance. The signature is::"
msgstr ""
-#: ../../c-api/typeobj.rst:1985
+#: ../../c-api/typeobj.rst:2027
msgid "int tp_is_gc(PyObject *self);"
msgstr "int tp_is_gc(PyObject *self);"
-#: ../../c-api/typeobj.rst:1987
+#: ../../c-api/typeobj.rst:2029
msgid ""
-"(The only example of this are types themselves. The metatype, :c:data:"
-"`PyType_Type`, defines this function to distinguish between statically and :"
-"ref:`dynamically allocated types `.)"
+"(The only example of this are types themselves. The "
+"metatype, :c:data:`PyType_Type`, defines this function to distinguish "
+"between statically and :ref:`dynamically allocated types `.)"
msgstr ""
-#: ../../c-api/typeobj.rst:1997
+#: ../../c-api/typeobj.rst:2039
msgid ""
-"This slot has no default. If this field is ``NULL``, :c:macro:"
-"`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent."
+"This slot has no default. If this field is "
+"``NULL``, :c:macro:`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent."
msgstr ""
-#: ../../c-api/typeobj.rst:2003
+#: ../../c-api/typeobj.rst:2045
msgid "Tuple of base types."
msgstr ""
-#: ../../c-api/typeobj.rst:2005 ../../c-api/typeobj.rst:2029
+#: ../../c-api/typeobj.rst:2047 ../../c-api/typeobj.rst:2071
msgid ""
"This field should be set to ``NULL`` and treated as read-only. Python will "
"fill it in when the type is :c:func:`initialized `."
msgstr ""
-#: ../../c-api/typeobj.rst:2008
+#: ../../c-api/typeobj.rst:2050
msgid ""
"For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot "
-"` can be used instead of the *bases* argument of :c:func:"
-"`PyType_FromSpecWithBases`. The argument form is preferred."
+"` can be used instead of the *bases* argument "
+"of :c:func:`PyType_FromSpecWithBases`. The argument form is preferred."
msgstr ""
-#: ../../c-api/typeobj.rst:2015
+#: ../../c-api/typeobj.rst:2057
msgid ""
"Multiple inheritance does not work well for statically defined types. If you "
"set ``tp_bases`` to a tuple, Python will not raise an error, but some slots "
"will only be inherited from the first base."
msgstr ""
-#: ../../c-api/typeobj.rst:2021 ../../c-api/typeobj.rst:2044
-#: ../../c-api/typeobj.rst:2061 ../../c-api/typeobj.rst:2078
-#: ../../c-api/typeobj.rst:2092
+#: ../../c-api/typeobj.rst:2063 ../../c-api/typeobj.rst:2086
+#: ../../c-api/typeobj.rst:2103 ../../c-api/typeobj.rst:2120
+#: ../../c-api/typeobj.rst:2134
msgid "This field is not inherited."
msgstr ""
-#: ../../c-api/typeobj.rst:2026
+#: ../../c-api/typeobj.rst:2068
msgid ""
"Tuple containing the expanded set of base types, starting with the type "
"itself and ending with :class:`object`, in Method Resolution Order."
msgstr ""
-#: ../../c-api/typeobj.rst:2034
+#: ../../c-api/typeobj.rst:2076
msgid ""
-"This field is not inherited; it is calculated fresh by :c:func:"
-"`PyType_Ready`."
+"This field is not inherited; it is calculated fresh "
+"by :c:func:`PyType_Ready`."
msgstr ""
-#: ../../c-api/typeobj.rst:2040
+#: ../../c-api/typeobj.rst:2082
msgid "Unused. Internal use only."
msgstr ""
-#: ../../c-api/typeobj.rst:2049
+#: ../../c-api/typeobj.rst:2091
msgid ""
"A collection of subclasses. Internal use only. May be an invalid pointer."
msgstr ""
-#: ../../c-api/typeobj.rst:2051
+#: ../../c-api/typeobj.rst:2093
msgid ""
-"To get a list of subclasses, call the Python method :py:meth:`~type."
-"__subclasses__`."
+"To get a list of subclasses, call the Python "
+"method :py:meth:`~type.__subclasses__`."
msgstr ""
-#: ../../c-api/typeobj.rst:2056
+#: ../../c-api/typeobj.rst:2098
msgid ""
"For some types, this field does not hold a valid :c:expr:`PyObject*`. The "
"type was changed to :c:expr:`void*` to indicate this."
msgstr ""
-#: ../../c-api/typeobj.rst:2066
+#: ../../c-api/typeobj.rst:2108
msgid ""
"Weak reference list head, for weak references to this type object. Not "
"inherited. Internal use only."
msgstr ""
-#: ../../c-api/typeobj.rst:2071
+#: ../../c-api/typeobj.rst:2113
msgid ""
"Internals detail: For the static builtin types this is always ``NULL``, even "
"if weakrefs are added. Instead, the weakrefs for each are stored on "
@@ -3268,25 +3353,25 @@ msgid ""
"``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction."
msgstr ""
-#: ../../c-api/typeobj.rst:2083
+#: ../../c-api/typeobj.rst:2125
msgid ""
"This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead."
msgstr ""
-#: ../../c-api/typeobj.rst:2088
+#: ../../c-api/typeobj.rst:2130
msgid "Used to index into the method cache. Internal use only."
msgstr ""
-#: ../../c-api/typeobj.rst:2097
+#: ../../c-api/typeobj.rst:2139
msgid ""
"An optional pointer to an instance finalization function. Its signature is::"
msgstr ""
-#: ../../c-api/typeobj.rst:2099
+#: ../../c-api/typeobj.rst:2141
msgid "void tp_finalize(PyObject *self);"
msgstr "void tp_finalize(PyObject *self);"
-#: ../../c-api/typeobj.rst:2101
+#: ../../c-api/typeobj.rst:2143
msgid ""
"If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it "
"once when finalizing an instance. It is called either from the garbage "
@@ -3296,138 +3381,136 @@ msgid ""
"object in a sane state."
msgstr ""
-#: ../../c-api/typeobj.rst:2108
+#: ../../c-api/typeobj.rst:2150
msgid ""
":c:member:`~PyTypeObject.tp_finalize` should not mutate the current "
"exception status; therefore, a recommended way to write a non-trivial "
"finalizer is::"
msgstr ""
-#: ../../c-api/typeobj.rst:2111
+#: ../../c-api/typeobj.rst:2153
msgid ""
"static void\n"
"local_finalize(PyObject *self)\n"
"{\n"
-" PyObject *error_type, *error_value, *error_traceback;\n"
-"\n"
" /* Save the current exception, if any. */\n"
-" PyErr_Fetch(&error_type, &error_value, &error_traceback);\n"
+" PyObject *exc = PyErr_GetRaisedException();\n"
"\n"
" /* ... */\n"
"\n"
" /* Restore the saved exception. */\n"
-" PyErr_Restore(error_type, error_value, error_traceback);\n"
+" PyErr_SetRaisedException(exc);\n"
"}"
msgstr ""
-#: ../../c-api/typeobj.rst:2133
+#: ../../c-api/typeobj.rst:2173
msgid ""
-"Before version 3.8 it was necessary to set the :c:macro:"
-"`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. "
-"This is no longer required."
+"Before version 3.8 it was necessary to set "
+"the :c:macro:`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to "
+"be used. This is no longer required."
msgstr ""
-#: ../../c-api/typeobj.rst:2137
+#: ../../c-api/typeobj.rst:2177
msgid "\"Safe object finalization\" (:pep:`442`)"
msgstr ""
-#: ../../c-api/typeobj.rst:2142
+#: ../../c-api/typeobj.rst:2182
msgid ""
"Vectorcall function to use for calls of this type object. In other words, it "
"is used to implement :ref:`vectorcall ` for ``type.__call__``. "
-"If ``tp_vectorcall`` is ``NULL``, the default call implementation using :"
-"meth:`~object.__new__` and :meth:`~object.__init__` is used."
+"If ``tp_vectorcall`` is ``NULL``, the default call implementation "
+"using :meth:`~object.__new__` and :meth:`~object.__init__` is used."
msgstr ""
-#: ../../c-api/typeobj.rst:2150
+#: ../../c-api/typeobj.rst:2190
msgid "This field is never inherited."
msgstr ""
-#: ../../c-api/typeobj.rst:2152
+#: ../../c-api/typeobj.rst:2192
msgid "(the field exists since 3.8 but it's only used since 3.9)"
msgstr ""
-#: ../../c-api/typeobj.rst:2157
+#: ../../c-api/typeobj.rst:2197
msgid "Internal. Do not use."
msgstr ""
-#: ../../c-api/typeobj.rst:2165
+#: ../../c-api/typeobj.rst:2205
msgid "Static Types"
msgstr ""
-#: ../../c-api/typeobj.rst:2167
+#: ../../c-api/typeobj.rst:2207
msgid ""
-"Traditionally, types defined in C code are *static*, that is, a static :c:"
-"type:`PyTypeObject` structure is defined directly in code and initialized "
-"using :c:func:`PyType_Ready`."
+"Traditionally, types defined in C code are *static*, that is, a "
+"static :c:type:`PyTypeObject` structure is defined directly in code and "
+"initialized using :c:func:`PyType_Ready`."
msgstr ""
-#: ../../c-api/typeobj.rst:2171
+#: ../../c-api/typeobj.rst:2211
msgid ""
"This results in types that are limited relative to types defined in Python:"
msgstr ""
-#: ../../c-api/typeobj.rst:2173
+#: ../../c-api/typeobj.rst:2213
msgid ""
"Static types are limited to one base, i.e. they cannot use multiple "
"inheritance."
msgstr ""
-#: ../../c-api/typeobj.rst:2175
+#: ../../c-api/typeobj.rst:2215
msgid ""
"Static type objects (but not necessarily their instances) are immutable. It "
"is not possible to add or modify the type object's attributes from Python."
msgstr ""
-#: ../../c-api/typeobj.rst:2177
+#: ../../c-api/typeobj.rst:2217
msgid ""
"Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-"
"specific state."
msgstr ""
-#: ../../c-api/typeobj.rst:2181
+#: ../../c-api/typeobj.rst:2221
msgid ""
"Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API "
"` as an opaque struct, any extension modules using static "
"types must be compiled for a specific Python minor version."
msgstr ""
-#: ../../c-api/typeobj.rst:2189
+#: ../../c-api/typeobj.rst:2229
msgid "Heap Types"
msgstr ""
-#: ../../c-api/typeobj.rst:2191
+#: ../../c-api/typeobj.rst:2231
msgid ""
"An alternative to :ref:`static types ` is *heap-allocated "
"types*, or *heap types* for short, which correspond closely to classes "
-"created by Python's ``class`` statement. Heap types have the :c:macro:"
-"`Py_TPFLAGS_HEAPTYPE` flag set."
+"created by Python's ``class`` statement. Heap types have "
+"the :c:macro:`Py_TPFLAGS_HEAPTYPE` flag set."
msgstr ""
-#: ../../c-api/typeobj.rst:2196
+#: ../../c-api/typeobj.rst:2236
msgid ""
-"This is done by filling a :c:type:`PyType_Spec` structure and calling :c:"
-"func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:"
-"`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`."
+"This is done by filling a :c:type:`PyType_Spec` structure and "
+"calling :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:`PyType_FromModuleAndSpec`, "
+"or :c:func:`PyType_FromMetaclass`."
msgstr ""
-#: ../../c-api/typeobj.rst:2204
+#: ../../c-api/typeobj.rst:2244
msgid "Number Object Structures"
msgstr ""
-#: ../../c-api/typeobj.rst:2211
+#: ../../c-api/typeobj.rst:2251
msgid ""
"This structure holds pointers to the functions which an object uses to "
"implement the number protocol. Each function is used by the function of "
"similar name documented in the :ref:`number` section."
msgstr ""
-#: ../../c-api/typeobj.rst:2217 ../../c-api/typeobj.rst:2541
+#: ../../c-api/typeobj.rst:2257 ../../c-api/typeobj.rst:2581
msgid "Here is the structure definition::"
msgstr ""
-#: ../../c-api/typeobj.rst:2219
+#: ../../c-api/typeobj.rst:2259
msgid ""
"typedef struct {\n"
" binaryfunc nb_add;\n"
@@ -3515,7 +3598,7 @@ msgstr ""
" binaryfunc nb_inplace_matrix_multiply;\n"
"} PyNumberMethods;"
-#: ../../c-api/typeobj.rst:2264
+#: ../../c-api/typeobj.rst:2304
msgid ""
"Binary and ternary functions must check the type of all their operands, and "
"implement the necessary conversions (at least one of the operands is an "
@@ -3525,81 +3608,82 @@ msgid ""
"and set an exception."
msgstr ""
-#: ../../c-api/typeobj.rst:2273
+#: ../../c-api/typeobj.rst:2313
msgid ""
"The :c:member:`~PyNumberMethods.nb_reserved` field should always be "
"``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in "
"Python 3.0.1."
msgstr ""
-#: ../../c-api/typeobj.rst:2318
+#: ../../c-api/typeobj.rst:2358
msgid "Mapping Object Structures"
msgstr ""
-#: ../../c-api/typeobj.rst:2325
+#: ../../c-api/typeobj.rst:2365
msgid ""
"This structure holds pointers to the functions which an object uses to "
"implement the mapping protocol. It has three members:"
msgstr ""
-#: ../../c-api/typeobj.rst:2330
+#: ../../c-api/typeobj.rst:2370
msgid ""
-"This function is used by :c:func:`PyMapping_Size` and :c:func:"
-"`PyObject_Size`, and has the same signature. This slot may be set to "
-"``NULL`` if the object has no defined length."
+"This function is used by :c:func:`PyMapping_Size` "
+"and :c:func:`PyObject_Size`, and has the same signature. This slot may be "
+"set to ``NULL`` if the object has no defined length."
msgstr ""
-#: ../../c-api/typeobj.rst:2336
+#: ../../c-api/typeobj.rst:2376
msgid ""
-"This function is used by :c:func:`PyObject_GetItem` and :c:func:"
-"`PySequence_GetSlice`, and has the same signature as :c:func:`!"
-"PyObject_GetItem`. This slot must be filled for the :c:func:"
-"`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise."
+"This function is used by :c:func:`PyObject_GetItem` "
+"and :c:func:`PySequence_GetSlice`, and has the same signature as :c:func:`!"
+"PyObject_GetItem`. This slot must be filled for "
+"the :c:func:`PyMapping_Check` function to return ``1``, it can be ``NULL`` "
+"otherwise."
msgstr ""
-#: ../../c-api/typeobj.rst:2344
+#: ../../c-api/typeobj.rst:2384
msgid ""
-"This function is used by :c:func:`PyObject_SetItem`, :c:func:"
-"`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and :c:func:"
-"`PySequence_DelSlice`. It has the same signature as :c:func:`!"
+"This function is used "
+"by :c:func:`PyObject_SetItem`, :c:func:`PyObject_DelItem`, :c:func:`PySequence_SetSlice` "
+"and :c:func:`PySequence_DelSlice`. It has the same signature as :c:func:`!"
"PyObject_SetItem`, but *v* can also be set to ``NULL`` to delete an item. "
"If this slot is ``NULL``, the object does not support item assignment and "
"deletion."
msgstr ""
-#: ../../c-api/typeobj.rst:2355
+#: ../../c-api/typeobj.rst:2395
msgid "Sequence Object Structures"
msgstr ""
-#: ../../c-api/typeobj.rst:2362
+#: ../../c-api/typeobj.rst:2402
msgid ""
"This structure holds pointers to the functions which an object uses to "
"implement the sequence protocol."
msgstr ""
-#: ../../c-api/typeobj.rst:2367
+#: ../../c-api/typeobj.rst:2407
msgid ""
-"This function is used by :c:func:`PySequence_Size` and :c:func:"
-"`PyObject_Size`, and has the same signature. It is also used for handling "
-"negative indices via the :c:member:`~PySequenceMethods.sq_item` and the :c:"
-"member:`~PySequenceMethods.sq_ass_item` slots."
+"This function is used by :c:func:`PySequence_Size` "
+"and :c:func:`PyObject_Size`, and has the same signature. It is also used "
+"for handling negative indices via the :c:member:`~PySequenceMethods.sq_item` "
+"and the :c:member:`~PySequenceMethods.sq_ass_item` slots."
msgstr ""
-#: ../../c-api/typeobj.rst:2374
+#: ../../c-api/typeobj.rst:2414
msgid ""
"This function is used by :c:func:`PySequence_Concat` and has the same "
"signature. It is also used by the ``+`` operator, after trying the numeric "
"addition via the :c:member:`~PyNumberMethods.nb_add` slot."
msgstr ""
-#: ../../c-api/typeobj.rst:2380
+#: ../../c-api/typeobj.rst:2420
msgid ""
"This function is used by :c:func:`PySequence_Repeat` and has the same "
"signature. It is also used by the ``*`` operator, after trying numeric "
"multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot."
msgstr ""
-#: ../../c-api/typeobj.rst:2386
+#: ../../c-api/typeobj.rst:2426
msgid ""
"This function is used by :c:func:`PySequence_GetItem` and has the same "
"signature. It is also used by :c:func:`PyObject_GetItem`, after trying the "
@@ -3608,42 +3692,43 @@ msgid ""
"``1``, it can be ``NULL`` otherwise."
msgstr ""
-#: ../../c-api/typeobj.rst:2392
+#: ../../c-api/typeobj.rst:2432
msgid ""
-"Negative indexes are handled as follows: if the :c:member:"
-"`~PySequenceMethods.sq_length` slot is filled, it is called and the sequence "
-"length is used to compute a positive index which is passed to :c:member:"
-"`~PySequenceMethods.sq_item`. If :c:member:`!sq_length` is ``NULL``, the "
-"index is passed as is to the function."
+"Negative indexes are handled as follows: if "
+"the :c:member:`~PySequenceMethods.sq_length` slot is filled, it is called "
+"and the sequence length is used to compute a positive index which is passed "
+"to :c:member:`~PySequenceMethods.sq_item`. If :c:member:`!sq_length` is "
+"``NULL``, the index is passed as is to the function."
msgstr ""
-#: ../../c-api/typeobj.rst:2399
+#: ../../c-api/typeobj.rst:2439
msgid ""
"This function is used by :c:func:`PySequence_SetItem` and has the same "
-"signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:"
-"`PyObject_DelItem`, after trying the item assignment and deletion via the :c:"
-"member:`~PyMappingMethods.mp_ass_subscript` slot. This slot may be left to "
-"``NULL`` if the object does not support item assignment and deletion."
+"signature. It is also used by :c:func:`PyObject_SetItem` "
+"and :c:func:`PyObject_DelItem`, after trying the item assignment and "
+"deletion via the :c:member:`~PyMappingMethods.mp_ass_subscript` slot. This "
+"slot may be left to ``NULL`` if the object does not support item assignment "
+"and deletion."
msgstr ""
-#: ../../c-api/typeobj.rst:2408
+#: ../../c-api/typeobj.rst:2448
msgid ""
"This function may be used by :c:func:`PySequence_Contains` and has the same "
"signature. This slot may be left to ``NULL``, in this case :c:func:`!"
"PySequence_Contains` simply traverses the sequence until it finds a match."
msgstr ""
-#: ../../c-api/typeobj.rst:2415
+#: ../../c-api/typeobj.rst:2455
msgid ""
"This function is used by :c:func:`PySequence_InPlaceConcat` and has the same "
"signature. It should modify its first operand, and return it. This slot "
"may be left to ``NULL``, in this case :c:func:`!PySequence_InPlaceConcat` "
"will fall back to :c:func:`PySequence_Concat`. It is also used by the "
-"augmented assignment ``+=``, after trying numeric in-place addition via the :"
-"c:member:`~PyNumberMethods.nb_inplace_add` slot."
+"augmented assignment ``+=``, after trying numeric in-place addition via "
+"the :c:member:`~PyNumberMethods.nb_inplace_add` slot."
msgstr ""
-#: ../../c-api/typeobj.rst:2424
+#: ../../c-api/typeobj.rst:2464
msgid ""
"This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same "
"signature. It should modify its first operand, and return it. This slot "
@@ -3653,76 +3738,76 @@ msgid ""
"via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot."
msgstr ""
-#: ../../c-api/typeobj.rst:2435
+#: ../../c-api/typeobj.rst:2475
msgid "Buffer Object Structures"
msgstr ""
-#: ../../c-api/typeobj.rst:2443
+#: ../../c-api/typeobj.rst:2483
msgid ""
"This structure holds pointers to the functions required by the :ref:`Buffer "
"protocol `. The protocol defines how an exporter object can "
"expose its internal data to consumer objects."
msgstr ""
-#: ../../c-api/typeobj.rst:2449 ../../c-api/typeobj.rst:2498
-#: ../../c-api/typeobj.rst:2552 ../../c-api/typeobj.rst:2563
-#: ../../c-api/typeobj.rst:2575 ../../c-api/typeobj.rst:2585
+#: ../../c-api/typeobj.rst:2489 ../../c-api/typeobj.rst:2538
+#: ../../c-api/typeobj.rst:2592 ../../c-api/typeobj.rst:2603
+#: ../../c-api/typeobj.rst:2615 ../../c-api/typeobj.rst:2625
msgid "The signature of this function is::"
msgstr ""
-#: ../../c-api/typeobj.rst:2451
+#: ../../c-api/typeobj.rst:2491
msgid "int (PyObject *exporter, Py_buffer *view, int flags);"
msgstr "int (PyObject *exporter, Py_buffer *view, int flags);"
-#: ../../c-api/typeobj.rst:2453
+#: ../../c-api/typeobj.rst:2493
msgid ""
"Handle a request to *exporter* to fill in *view* as specified by *flags*. "
"Except for point (3), an implementation of this function MUST take these "
"steps:"
msgstr ""
-#: ../../c-api/typeobj.rst:2457
+#: ../../c-api/typeobj.rst:2497
msgid ""
-"Check if the request can be met. If not, raise :exc:`BufferError`, set :c:"
-"expr:`view->obj` to ``NULL`` and return ``-1``."
+"Check if the request can be met. If not, raise :exc:`BufferError`, "
+"set :c:expr:`view->obj` to ``NULL`` and return ``-1``."
msgstr ""
-#: ../../c-api/typeobj.rst:2460
+#: ../../c-api/typeobj.rst:2500
msgid "Fill in the requested fields."
msgstr ""
-#: ../../c-api/typeobj.rst:2462
+#: ../../c-api/typeobj.rst:2502
msgid "Increment an internal counter for the number of exports."
msgstr ""
-#: ../../c-api/typeobj.rst:2464
+#: ../../c-api/typeobj.rst:2504
msgid ""
"Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`."
msgstr ""
-#: ../../c-api/typeobj.rst:2466
+#: ../../c-api/typeobj.rst:2506
msgid "Return ``0``."
msgstr "回傳 ``0``。"
-#: ../../c-api/typeobj.rst:2468
+#: ../../c-api/typeobj.rst:2508
msgid ""
"If *exporter* is part of a chain or tree of buffer providers, two main "
"schemes can be used:"
msgstr ""
-#: ../../c-api/typeobj.rst:2471
+#: ../../c-api/typeobj.rst:2511
msgid ""
-"Re-export: Each member of the tree acts as the exporting object and sets :c:"
-"expr:`view->obj` to a new reference to itself."
+"Re-export: Each member of the tree acts as the exporting object and "
+"sets :c:expr:`view->obj` to a new reference to itself."
msgstr ""
-#: ../../c-api/typeobj.rst:2474
+#: ../../c-api/typeobj.rst:2514
msgid ""
"Redirect: The buffer request is redirected to the root object of the tree. "
"Here, :c:expr:`view->obj` will be a new reference to the root object."
msgstr ""
-#: ../../c-api/typeobj.rst:2478
+#: ../../c-api/typeobj.rst:2518
msgid ""
"The individual fields of *view* are described in section :ref:`Buffer "
"structure `, the rules how an exporter must react to "
@@ -3730,32 +3815,31 @@ msgid ""
"types>`."
msgstr ""
-#: ../../c-api/typeobj.rst:2483
+#: ../../c-api/typeobj.rst:2523
msgid ""
"All memory pointed to in the :c:type:`Py_buffer` structure belongs to the "
-"exporter and must remain valid until there are no consumers left. :c:member:"
-"`~Py_buffer.format`, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer."
-"strides`, :c:member:`~Py_buffer.suboffsets` and :c:member:`~Py_buffer."
-"internal` are read-only for the consumer."
+"exporter and must remain valid until there are no consumers "
+"left. :c:member:`~Py_buffer.format`, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer.strides`, :c:member:`~Py_buffer.suboffsets` "
+"and :c:member:`~Py_buffer.internal` are read-only for the consumer."
msgstr ""
-#: ../../c-api/typeobj.rst:2490
+#: ../../c-api/typeobj.rst:2530
msgid ""
":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes "
"buffer while dealing correctly with all request types."
msgstr ""
-#: ../../c-api/typeobj.rst:2493
+#: ../../c-api/typeobj.rst:2533
msgid ""
":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps "
"this function."
msgstr ""
-#: ../../c-api/typeobj.rst:2500
+#: ../../c-api/typeobj.rst:2540
msgid "void (PyObject *exporter, Py_buffer *view);"
msgstr "void (PyObject *exporter, Py_buffer *view);"
-#: ../../c-api/typeobj.rst:2502
+#: ../../c-api/typeobj.rst:2542
msgid ""
"Handle a request to release the resources of the buffer. If no resources "
"need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be "
@@ -3763,15 +3847,15 @@ msgid ""
"these optional steps:"
msgstr ""
-#: ../../c-api/typeobj.rst:2507
+#: ../../c-api/typeobj.rst:2547
msgid "Decrement an internal counter for the number of exports."
msgstr ""
-#: ../../c-api/typeobj.rst:2509
+#: ../../c-api/typeobj.rst:2549
msgid "If the counter is ``0``, free all memory associated with *view*."
msgstr ""
-#: ../../c-api/typeobj.rst:2511
+#: ../../c-api/typeobj.rst:2551
msgid ""
"The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep "
"track of buffer-specific resources. This field is guaranteed to remain "
@@ -3779,30 +3863,30 @@ msgid ""
"*view* argument."
msgstr ""
-#: ../../c-api/typeobj.rst:2517
+#: ../../c-api/typeobj.rst:2557
msgid ""
"This function MUST NOT decrement :c:expr:`view->obj`, since that is done "
"automatically in :c:func:`PyBuffer_Release` (this scheme is useful for "
"breaking reference cycles)."
msgstr ""
-#: ../../c-api/typeobj.rst:2522
+#: ../../c-api/typeobj.rst:2562
msgid ""
":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this "
"function."
msgstr ""
-#: ../../c-api/typeobj.rst:2530
+#: ../../c-api/typeobj.rst:2570
msgid "Async Object Structures"
msgstr ""
-#: ../../c-api/typeobj.rst:2538
+#: ../../c-api/typeobj.rst:2578
msgid ""
-"This structure holds pointers to the functions required to implement :term:"
-"`awaitable` and :term:`asynchronous iterator` objects."
+"This structure holds pointers to the functions required to "
+"implement :term:`awaitable` and :term:`asynchronous iterator` objects."
msgstr ""
-#: ../../c-api/typeobj.rst:2543
+#: ../../c-api/typeobj.rst:2583
msgid ""
"typedef struct {\n"
" unaryfunc am_await;\n"
@@ -3818,149 +3902,150 @@ msgstr ""
" sendfunc am_send;\n"
"} PyAsyncMethods;"
-#: ../../c-api/typeobj.rst:2554
+#: ../../c-api/typeobj.rst:2594
msgid "PyObject *am_await(PyObject *self);"
msgstr ""
-#: ../../c-api/typeobj.rst:2556
+#: ../../c-api/typeobj.rst:2596
msgid ""
"The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` "
"must return ``1`` for it."
msgstr ""
-#: ../../c-api/typeobj.rst:2559
+#: ../../c-api/typeobj.rst:2599
msgid ""
"This slot may be set to ``NULL`` if an object is not an :term:`awaitable`."
msgstr ""
-#: ../../c-api/typeobj.rst:2565
+#: ../../c-api/typeobj.rst:2605
msgid "PyObject *am_aiter(PyObject *self);"
msgstr "PyObject *am_aiter(PyObject *self);"
-#: ../../c-api/typeobj.rst:2567
+#: ../../c-api/typeobj.rst:2607
msgid ""
-"Must return an :term:`asynchronous iterator` object. See :meth:`~object."
-"__anext__` for details."
+"Must return an :term:`asynchronous iterator` object. "
+"See :meth:`~object.__anext__` for details."
msgstr ""
-#: ../../c-api/typeobj.rst:2570
+#: ../../c-api/typeobj.rst:2610
msgid ""
"This slot may be set to ``NULL`` if an object does not implement "
"asynchronous iteration protocol."
msgstr ""
-#: ../../c-api/typeobj.rst:2577
+#: ../../c-api/typeobj.rst:2617
msgid "PyObject *am_anext(PyObject *self);"
msgstr "PyObject *am_anext(PyObject *self);"
-#: ../../c-api/typeobj.rst:2579
+#: ../../c-api/typeobj.rst:2619
msgid ""
"Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for "
"details. This slot may be set to ``NULL``."
msgstr ""
-#: ../../c-api/typeobj.rst:2587
+#: ../../c-api/typeobj.rst:2627
msgid "PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);"
msgstr ""
"PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);"
-#: ../../c-api/typeobj.rst:2589
+#: ../../c-api/typeobj.rst:2629
msgid ""
"See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``."
msgstr ""
-#: ../../c-api/typeobj.rst:2598
+#: ../../c-api/typeobj.rst:2638
msgid "Slot Type typedefs"
msgstr ""
-#: ../../c-api/typeobj.rst:2602
+#: ../../c-api/typeobj.rst:2642
msgid ""
"The purpose of this function is to separate memory allocation from memory "
"initialization. It should return a pointer to a block of memory of adequate "
"length for the instance, suitably aligned, and initialized to zeros, but "
-"with :c:member:`~PyObject.ob_refcnt` set to ``1`` and :c:member:`~PyObject."
-"ob_type` set to the type argument. If the type's :c:member:`~PyTypeObject."
-"tp_itemsize` is non-zero, the object's :c:member:`~PyVarObject.ob_size` "
-"field should be initialized to *nitems* and the length of the allocated "
-"memory block should be ``tp_basicsize + nitems*tp_itemsize``, rounded up to "
-"a multiple of ``sizeof(void*)``; otherwise, *nitems* is not used and the "
-"length of the block should be :c:member:`~PyTypeObject.tp_basicsize`."
+"with :c:member:`~PyObject.ob_refcnt` set to ``1`` "
+"and :c:member:`~PyObject.ob_type` set to the type argument. If the "
+"type's :c:member:`~PyTypeObject.tp_itemsize` is non-zero, the "
+"object's :c:member:`~PyVarObject.ob_size` field should be initialized to "
+"*nitems* and the length of the allocated memory block should be "
+"``tp_basicsize + nitems*tp_itemsize``, rounded up to a multiple of "
+"``sizeof(void*)``; otherwise, *nitems* is not used and the length of the "
+"block should be :c:member:`~PyTypeObject.tp_basicsize`."
msgstr ""
-#: ../../c-api/typeobj.rst:2612
+#: ../../c-api/typeobj.rst:2652
msgid ""
"This function should not do any other instance initialization, not even to "
-"allocate additional memory; that should be done by :c:member:`~PyTypeObject."
-"tp_new`."
+"allocate additional memory; that should be done "
+"by :c:member:`~PyTypeObject.tp_new`."
msgstr ""
-#: ../../c-api/typeobj.rst:2619
+#: ../../c-api/typeobj.rst:2659
msgid "See :c:member:`~PyTypeObject.tp_free`."
msgstr "請見 :c:member:`~PyTypeObject.tp_free`。"
-#: ../../c-api/typeobj.rst:2623
+#: ../../c-api/typeobj.rst:2663
msgid "See :c:member:`~PyTypeObject.tp_new`."
msgstr "請見 :c:member:`~PyTypeObject.tp_new`。"
-#: ../../c-api/typeobj.rst:2627
+#: ../../c-api/typeobj.rst:2667
msgid "See :c:member:`~PyTypeObject.tp_init`."
msgstr "請見 :c:member:`~PyTypeObject.tp_init`。"
-#: ../../c-api/typeobj.rst:2631
+#: ../../c-api/typeobj.rst:2671
msgid "See :c:member:`~PyTypeObject.tp_repr`."
msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。"
-#: ../../c-api/typeobj.rst:2635 ../../c-api/typeobj.rst:2644
+#: ../../c-api/typeobj.rst:2675 ../../c-api/typeobj.rst:2684
msgid "Return the value of the named attribute for the object."
msgstr ""
-#: ../../c-api/typeobj.rst:2639 ../../c-api/typeobj.rst:2650
+#: ../../c-api/typeobj.rst:2679 ../../c-api/typeobj.rst:2690
msgid ""
"Set the value of the named attribute for the object. The value argument is "
"set to ``NULL`` to delete the attribute."
msgstr ""
-#: ../../c-api/typeobj.rst:2646
+#: ../../c-api/typeobj.rst:2686
msgid "See :c:member:`~PyTypeObject.tp_getattro`."
msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。"
-#: ../../c-api/typeobj.rst:2653
+#: ../../c-api/typeobj.rst:2693
msgid "See :c:member:`~PyTypeObject.tp_setattro`."
msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。"
-#: ../../c-api/typeobj.rst:2657
+#: ../../c-api/typeobj.rst:2697
msgid "See :c:member:`~PyTypeObject.tp_descr_get`."
msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。"
-#: ../../c-api/typeobj.rst:2661
+#: ../../c-api/typeobj.rst:2701
msgid "See :c:member:`~PyTypeObject.tp_descr_set`."
msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。"
-#: ../../c-api/typeobj.rst:2665
+#: ../../c-api/typeobj.rst:2705
msgid "See :c:member:`~PyTypeObject.tp_hash`."
msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。"
-#: ../../c-api/typeobj.rst:2669
+#: ../../c-api/typeobj.rst:2709
msgid "See :c:member:`~PyTypeObject.tp_richcompare`."
msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。"
-#: ../../c-api/typeobj.rst:2673
+#: ../../c-api/typeobj.rst:2713
msgid "See :c:member:`~PyTypeObject.tp_iter`."
msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。"
-#: ../../c-api/typeobj.rst:2677
+#: ../../c-api/typeobj.rst:2717
msgid "See :c:member:`~PyTypeObject.tp_iternext`."
msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。"
-#: ../../c-api/typeobj.rst:2691
+#: ../../c-api/typeobj.rst:2731
msgid "See :c:member:`~PyAsyncMethods.am_send`."
msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。"
-#: ../../c-api/typeobj.rst:2707
+#: ../../c-api/typeobj.rst:2747
msgid "Examples"
msgstr "範例"
-#: ../../c-api/typeobj.rst:2709
+#: ../../c-api/typeobj.rst:2749
msgid ""
"The following are simple examples of Python type definitions. They include "
"common usage you may encounter. Some demonstrate tricky corner cases. For "
@@ -3968,11 +4053,11 @@ msgid ""
"and :ref:`new-types-topics`."
msgstr ""
-#: ../../c-api/typeobj.rst:2714
+#: ../../c-api/typeobj.rst:2754
msgid "A basic :ref:`static type `::"
msgstr ""
-#: ../../c-api/typeobj.rst:2716
+#: ../../c-api/typeobj.rst:2756
msgid ""
"typedef struct {\n"
" PyObject_HEAD\n"
@@ -3990,13 +4075,13 @@ msgid ""
"};"
msgstr ""
-#: ../../c-api/typeobj.rst:2731
+#: ../../c-api/typeobj.rst:2771
msgid ""
"You may also find older code (especially in the CPython code base) with a "
"more verbose initializer::"
msgstr ""
-#: ../../c-api/typeobj.rst:2734
+#: ../../c-api/typeobj.rst:2774
msgid ""
"static PyTypeObject MyObject_Type = {\n"
" PyVarObject_HEAD_INIT(NULL, 0)\n"
@@ -4080,11 +4165,11 @@ msgstr ""
" myobj_new, /* tp_new */\n"
"};"
-#: ../../c-api/typeobj.rst:2775
+#: ../../c-api/typeobj.rst:2815
msgid "A type that supports weakrefs, instance dicts, and hashing::"
msgstr ""
-#: ../../c-api/typeobj.rst:2777
+#: ../../c-api/typeobj.rst:2817
msgid ""
"typedef struct {\n"
" PyObject_HEAD\n"
@@ -4110,14 +4195,14 @@ msgid ""
"};"
msgstr ""
-#: ../../c-api/typeobj.rst:2800
+#: ../../c-api/typeobj.rst:2840
msgid ""
"A str subclass that cannot be subclassed and cannot be called to create "
-"instances (e.g. uses a separate factory func) using :c:macro:"
-"`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::"
+"instances (e.g. uses a separate factory func) "
+"using :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::"
msgstr ""
-#: ../../c-api/typeobj.rst:2804
+#: ../../c-api/typeobj.rst:2844
msgid ""
"typedef struct {\n"
" PyUnicodeObject raw;\n"
@@ -4135,12 +4220,12 @@ msgid ""
"};"
msgstr ""
-#: ../../c-api/typeobj.rst:2819
+#: ../../c-api/typeobj.rst:2859
msgid ""
"The simplest :ref:`static type ` with fixed-length instances::"
msgstr ""
-#: ../../c-api/typeobj.rst:2821
+#: ../../c-api/typeobj.rst:2861
msgid ""
"typedef struct {\n"
" PyObject_HEAD\n"
@@ -4160,13 +4245,13 @@ msgstr ""
" .tp_name = \"mymod.MyObject\",\n"
"};"
-#: ../../c-api/typeobj.rst:2830
+#: ../../c-api/typeobj.rst:2870
msgid ""
"The simplest :ref:`static type ` with variable-length "
"instances::"
msgstr ""
-#: ../../c-api/typeobj.rst:2832
+#: ../../c-api/typeobj.rst:2872
msgid ""
"typedef struct {\n"
" PyObject_VAR_HEAD\n"
@@ -4192,14 +4277,14 @@ msgstr ""
" .tp_itemsize = sizeof(char *),\n"
"};"
-#: ../../c-api/typeobj.rst:800 ../../c-api/typeobj.rst:865
+#: ../../c-api/typeobj.rst:842 ../../c-api/typeobj.rst:907
msgid "built-in function"
msgstr "built-in function(內建函式)"
-#: ../../c-api/typeobj.rst:800
+#: ../../c-api/typeobj.rst:842
msgid "repr"
msgstr "repr"
-#: ../../c-api/typeobj.rst:865
+#: ../../c-api/typeobj.rst:907
msgid "hash"
msgstr "hash(雜湊)"
diff --git a/c-api/unicode.po b/c-api/unicode.po
index 6049c55176..f29bafb0e6 100644
--- a/c-api/unicode.po
+++ b/c-api/unicode.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-01-21 00:13+0000\n"
+"POT-Creation-Date: 2025-04-30 00:15+0000\n"
"PO-Revision-Date: 2018-05-23 14:08+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -41,23 +41,25 @@ msgstr ""
#: ../../c-api/unicode.rst:20
msgid ""
"UTF-8 representation is created on demand and cached in the Unicode object."
-msgstr ""
+msgstr "UTF-8 表示法會在需要時建立並快取在 Unicode 物件中。"
#: ../../c-api/unicode.rst:23
msgid ""
"The :c:type:`Py_UNICODE` representation has been removed since Python 3.12 "
"with deprecated APIs. See :pep:`623` for more information."
msgstr ""
+"自 Python 3.12 起,已移除 :c:type:`Py_UNICODE` 表示法,並標示為已棄用的 API。"
+"更多資訊請參閱 :pep:`623`。"
#: ../../c-api/unicode.rst:29
msgid "Unicode Type"
-msgstr ""
+msgstr "Unicode 型別"
#: ../../c-api/unicode.rst:31
msgid ""
"These are the basic Unicode object types used for the Unicode implementation "
"in Python:"
-msgstr ""
+msgstr "這些是 Python 中用於 Unicode 實作的基本 Unicode 物件型別:"
#: ../../c-api/unicode.rst:38
msgid ""
@@ -88,59 +90,65 @@ msgstr ""
#: ../../c-api/unicode.rst:71
msgid ""
-"This instance of :c:type:`PyTypeObject` represents the Python Unicode type. "
+"This instance of :c:type:`PyTypeObject` represents the Python Unicode type. "
"It is exposed to Python code as ``str``."
msgstr ""
-#: ../../c-api/unicode.rst:75
+#: ../../c-api/unicode.rst:77
+msgid ""
+"This instance of :c:type:`PyTypeObject` represents the Python Unicode "
+"iterator type. It is used to iterate over Unicode string objects."
+msgstr ""
+
+#: ../../c-api/unicode.rst:81
msgid ""
"The following APIs are C macros and static inlined functions for fast checks "
"and access to internal read-only data of Unicode objects:"
msgstr ""
-#: ../../c-api/unicode.rst:80
+#: ../../c-api/unicode.rst:86
msgid ""
"Return true if the object *obj* is a Unicode object or an instance of a "
"Unicode subtype. This function always succeeds."
msgstr ""
-#: ../../c-api/unicode.rst:86
+#: ../../c-api/unicode.rst:92
msgid ""
"Return true if the object *obj* is a Unicode object, but not an instance of "
"a subtype. This function always succeeds."
msgstr ""
-#: ../../c-api/unicode.rst:92
+#: ../../c-api/unicode.rst:98
msgid "Returns ``0``. This API is kept only for backward compatibility."
-msgstr ""
+msgstr "回傳 ``0``。此 API 僅保留以維持向後相容性。"
-#: ../../c-api/unicode.rst:96
+#: ../../c-api/unicode.rst:102
msgid "This API does nothing since Python 3.12."
-msgstr ""
+msgstr "自 Python 3.12 起,此 API 不再執行任何動作。"
-#: ../../c-api/unicode.rst:102
+#: ../../c-api/unicode.rst:108
msgid ""
"Return the length of the Unicode string, in code points. *unicode* has to "
"be a Unicode object in the \"canonical\" representation (not checked)."
msgstr ""
-#: ../../c-api/unicode.rst:112
+#: ../../c-api/unicode.rst:118
msgid ""
"Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 "
"integer types for direct character access. No checks are performed if the "
-"canonical representation has the correct character size; "
-"use :c:func:`PyUnicode_KIND` to select the right function."
+"canonical representation has the correct character size; use :c:func:"
+"`PyUnicode_KIND` to select the right function."
msgstr ""
-#: ../../c-api/unicode.rst:124
+#: ../../c-api/unicode.rst:130
msgid "Return values of the :c:func:`PyUnicode_KIND` macro."
msgstr ""
-#: ../../c-api/unicode.rst:128
+#: ../../c-api/unicode.rst:134
msgid "``PyUnicode_WCHAR_KIND`` has been removed."
msgstr "``PyUnicode_WCHAR_KIND`` 已被移除。"
-#: ../../c-api/unicode.rst:134
+#: ../../c-api/unicode.rst:140
msgid ""
"Return one of the PyUnicode kind constants (see above) that indicate how "
"many bytes per character this Unicode object uses to store its data. "
@@ -148,140 +156,137 @@ msgid ""
"(not checked)."
msgstr ""
-#: ../../c-api/unicode.rst:143
+#: ../../c-api/unicode.rst:149
msgid ""
"Return a void pointer to the raw Unicode buffer. *unicode* has to be a "
"Unicode object in the \"canonical\" representation (not checked)."
msgstr ""
-#: ../../c-api/unicode.rst:152
+#: ../../c-api/unicode.rst:158
msgid ""
-"Write into a canonical representation *data* (as obtained "
-"with :c:func:`PyUnicode_DATA`). This function performs no sanity checks, "
-"and is intended for usage in loops. The caller should cache the *kind* "
-"value and *data* pointer as obtained from other calls. *index* is the index "
-"in the string (starts at 0) and *value* is the new code point value which "
-"should be written to that location."
+"Write into a canonical representation *data* (as obtained with :c:func:"
+"`PyUnicode_DATA`). This function performs no sanity checks, and is intended "
+"for usage in loops. The caller should cache the *kind* value and *data* "
+"pointer as obtained from other calls. *index* is the index in the string "
+"(starts at 0) and *value* is the new code point value which should be "
+"written to that location."
msgstr ""
-#: ../../c-api/unicode.rst:165
+#: ../../c-api/unicode.rst:171
msgid ""
-"Read a code point from a canonical representation *data* (as obtained "
-"with :c:func:`PyUnicode_DATA`). No checks or ready calls are performed."
+"Read a code point from a canonical representation *data* (as obtained with :"
+"c:func:`PyUnicode_DATA`). No checks or ready calls are performed."
msgstr ""
-#: ../../c-api/unicode.rst:173
+#: ../../c-api/unicode.rst:179
msgid ""
"Read a character from a Unicode object *unicode*, which must be in the "
-"\"canonical\" representation. This is less efficient "
-"than :c:func:`PyUnicode_READ` if you do multiple consecutive reads."
+"\"canonical\" representation. This is less efficient than :c:func:"
+"`PyUnicode_READ` if you do multiple consecutive reads."
msgstr ""
-#: ../../c-api/unicode.rst:182
+#: ../../c-api/unicode.rst:188
msgid ""
"Return the maximum code point that is suitable for creating another string "
"based on *unicode*, which must be in the \"canonical\" representation. This "
"is always an approximation but more efficient than iterating over the string."
msgstr ""
-#: ../../c-api/unicode.rst:191
+#: ../../c-api/unicode.rst:197
msgid ""
"Return ``1`` if the string is a valid identifier according to the language "
"definition, section :ref:`identifiers`. Return ``0`` otherwise."
msgstr ""
-#: ../../c-api/unicode.rst:194
+#: ../../c-api/unicode.rst:200
msgid ""
"The function does not call :c:func:`Py_FatalError` anymore if the string is "
"not ready."
msgstr ""
-#: ../../c-api/unicode.rst:200
+#: ../../c-api/unicode.rst:206
msgid "Unicode Character Properties"
msgstr ""
-#: ../../c-api/unicode.rst:202
+#: ../../c-api/unicode.rst:208
msgid ""
"Unicode provides many different character properties. The most often needed "
"ones are available through these macros which are mapped to C functions "
"depending on the Python configuration."
msgstr ""
-#: ../../c-api/unicode.rst:209
+#: ../../c-api/unicode.rst:215
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a whitespace character."
msgstr "根據 *ch* 是否為空白字元來回傳 ``1`` 或 ``0``。"
-#: ../../c-api/unicode.rst:214
+#: ../../c-api/unicode.rst:220
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a lowercase character."
msgstr "根據 *ch* 是否為小寫字元來回傳 ``1`` 或 ``0``。"
-#: ../../c-api/unicode.rst:219
+#: ../../c-api/unicode.rst:225
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is an uppercase character."
msgstr "根據 *ch* 是否為大寫字元來回傳 ``1`` 或 ``0``。"
-#: ../../c-api/unicode.rst:224
+#: ../../c-api/unicode.rst:230
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a titlecase character."
msgstr "根據 *ch* 是否為首字大寫字元來回傳 ``1`` 或 ``0``。"
-#: ../../c-api/unicode.rst:229
+#: ../../c-api/unicode.rst:235
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is a linebreak character."
msgstr "根據 *ch* 是否為換行字元來回傳 ``1`` 或 ``0``。"
-#: ../../c-api/unicode.rst:234
+#: ../../c-api/unicode.rst:240
msgid "Return ``1`` or ``0`` depending on whether *ch* is a decimal character."
msgstr "根據 *ch* 是否為十進位字元來回傳 ``1`` 或 ``0``。"
-#: ../../c-api/unicode.rst:239
+#: ../../c-api/unicode.rst:245
msgid "Return ``1`` or ``0`` depending on whether *ch* is a digit character."
msgstr "根據 *ch* 是否為數字 (digit) 字元來回傳 ``1`` 或 ``0``。"
-#: ../../c-api/unicode.rst:244
+#: ../../c-api/unicode.rst:250
msgid "Return ``1`` or ``0`` depending on whether *ch* is a numeric character."
msgstr "根據 *ch* 是否為數值 (numeric) 字元來回傳 ``1`` 或 ``0``。"
-#: ../../c-api/unicode.rst:249
+#: ../../c-api/unicode.rst:255
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is an alphabetic character."
msgstr "根據 *ch* 是否為字母字元來回傳 ``1`` 或 ``0``。"
-#: ../../c-api/unicode.rst:254
+#: ../../c-api/unicode.rst:260
msgid ""
"Return ``1`` or ``0`` depending on whether *ch* is an alphanumeric character."
msgstr "根據 *ch* 是否為字母數字 (alphanumeric) 字元來回傳 ``1`` 或 ``0``。"
-#: ../../c-api/unicode.rst:259
+#: ../../c-api/unicode.rst:265
msgid ""
-"Return ``1`` or ``0`` depending on whether *ch* is a printable character. "
-"Nonprintable characters are those characters defined in the Unicode "
-"character database as \"Other\" or \"Separator\", excepting the ASCII space "
-"(0x20) which is considered printable. (Note that printable characters in "
-"this context are those which should not be escaped when :func:`repr` is "
-"invoked on a string. It has no bearing on the handling of strings written "
-"to :data:`sys.stdout` or :data:`sys.stderr`.)"
+"Return ``1`` or ``0`` depending on whether *ch* is a printable character, in "
+"the sense of :meth:`str.isprintable`."
msgstr ""
+"根據 *ch* 是否為可列印字元(如 :meth:`str.isprintable` 所定義)來回傳 ``1`` "
+"或 ``0``。"
-#: ../../c-api/unicode.rst:268
+#: ../../c-api/unicode.rst:269
msgid "These APIs can be used for fast direct character conversions:"
-msgstr ""
+msgstr "這些 API 可用於快速直接字元轉換:"
-#: ../../c-api/unicode.rst:273
+#: ../../c-api/unicode.rst:274
msgid "Return the character *ch* converted to lower case."
msgstr "回傳轉換為小寫的 *ch* 字元。"
-#: ../../c-api/unicode.rst:278
+#: ../../c-api/unicode.rst:279
msgid "Return the character *ch* converted to upper case."
msgstr "回傳轉換為大寫的 *ch* 字元。"
-#: ../../c-api/unicode.rst:283
+#: ../../c-api/unicode.rst:284
msgid "Return the character *ch* converted to title case."
msgstr "回傳轉換為首字大寫的 *ch* 字元。"
-#: ../../c-api/unicode.rst:288
+#: ../../c-api/unicode.rst:289
msgid ""
"Return the character *ch* converted to a decimal positive integer. Return "
"``-1`` if this is not possible. This function does not raise exceptions."
@@ -289,7 +294,7 @@ msgstr ""
"回傳轉換為十進位正整數的 *ch* 字元,若無法轉換則回傳 ``-1``。此函式不會引發例"
"外。"
-#: ../../c-api/unicode.rst:294
+#: ../../c-api/unicode.rst:295
msgid ""
"Return the character *ch* converted to a single digit integer. Return ``-1`` "
"if this is not possible. This function does not raise exceptions."
@@ -297,7 +302,7 @@ msgstr ""
"回傳轉換為單一數字整數的 *ch* 字元,若無法轉換則回傳 ``-1``。此函式不會引發例"
"外。"
-#: ../../c-api/unicode.rst:300
+#: ../../c-api/unicode.rst:301
msgid ""
"Return the character *ch* converted to a double. Return ``-1.0`` if this is "
"not possible. This function does not raise exceptions."
@@ -305,25 +310,25 @@ msgstr ""
"回傳轉換為雙精度浮點數 (double) 的 *ch* 字元,若無法轉換則回傳 ``-1.0``。此函"
"式不會引發例外。"
-#: ../../c-api/unicode.rst:304
+#: ../../c-api/unicode.rst:305
msgid "These APIs can be used to work with surrogates:"
msgstr "這些 API 可用於處理代理字元:"
-#: ../../c-api/unicode.rst:308
+#: ../../c-api/unicode.rst:309
msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)."
msgstr "檢查 *ch* 是否為代理字元 (surrogate, ``0xD800 <= ch <= 0xDFFF``)。"
-#: ../../c-api/unicode.rst:312
+#: ../../c-api/unicode.rst:313
msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)."
msgstr ""
"檢查 *ch* 是否為高代理字元 (high surrogate, ``0xD800 <= ch <= 0xDBFF``)。"
-#: ../../c-api/unicode.rst:316
+#: ../../c-api/unicode.rst:317
msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)."
msgstr ""
"檢查 *ch* 是否為低代理字元 (low surrogate, ``0xDC00 <= ch <= 0xDFFF``)。"
-#: ../../c-api/unicode.rst:320
+#: ../../c-api/unicode.rst:321
msgid ""
"Join two surrogate code points and return a single :c:type:`Py_UCS4` value. "
"*high* and *low* are respectively the leading and trailing surrogates in a "
@@ -331,51 +336,50 @@ msgid ""
"be in the range [0xDC00; 0xDFFF]."
msgstr ""
-#: ../../c-api/unicode.rst:327
+#: ../../c-api/unicode.rst:328
msgid "Creating and accessing Unicode strings"
msgstr ""
-#: ../../c-api/unicode.rst:329
+#: ../../c-api/unicode.rst:330
msgid ""
"To create Unicode objects and access their basic sequence properties, use "
"these APIs:"
msgstr ""
-#: ../../c-api/unicode.rst:334
+#: ../../c-api/unicode.rst:335
msgid ""
"Create a new Unicode object. *maxchar* should be the true maximum code "
"point to be placed in the string. As an approximation, it can be rounded up "
"to the nearest value in the sequence 127, 255, 65535, 1114111."
msgstr ""
-#: ../../c-api/unicode.rst:338
+#: ../../c-api/unicode.rst:339
msgid ""
"This is the recommended way to allocate a new Unicode object. Objects "
"created using this function are not resizable."
msgstr ""
-#: ../../c-api/unicode.rst:341
+#: ../../c-api/unicode.rst:342
msgid "On error, set an exception and return ``NULL``."
msgstr ""
-#: ../../c-api/unicode.rst:349
+#: ../../c-api/unicode.rst:350
msgid ""
-"Create a new Unicode object with the given *kind* (possible values "
-"are :c:macro:`PyUnicode_1BYTE_KIND` etc., as returned "
-"by :c:func:`PyUnicode_KIND`). The *buffer* must point to an array of *size* "
-"units of 1, 2 or 4 bytes per character, as given by the kind."
+"Create a new Unicode object with the given *kind* (possible values are :c:"
+"macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:"
+"`PyUnicode_KIND`). The *buffer* must point to an array of *size* units of "
+"1, 2 or 4 bytes per character, as given by the kind."
msgstr ""
-#: ../../c-api/unicode.rst:354
+#: ../../c-api/unicode.rst:355
msgid ""
"If necessary, the input *buffer* is copied and transformed into the "
-"canonical representation. For example, if the *buffer* is a UCS4 string "
-"(:c:macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the "
-"UCS1 range, it will be transformed into UCS1 "
-"(:c:macro:`PyUnicode_1BYTE_KIND`)."
+"canonical representation. For example, if the *buffer* is a UCS4 string (:c:"
+"macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the UCS1 "
+"range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)."
msgstr ""
-#: ../../c-api/unicode.rst:365
+#: ../../c-api/unicode.rst:366
msgid ""
"Create a Unicode object from the char buffer *str*. The bytes will be "
"interpreted as being UTF-8 encoded. The buffer is copied into the new "
@@ -383,29 +387,29 @@ msgid ""
"data is not allowed."
msgstr ""
-#: ../../c-api/unicode.rst:371
+#: ../../c-api/unicode.rst:372
msgid "This function raises :exc:`SystemError` when:"
-msgstr ""
+msgstr "此函式在以下情況下會引發 :exc:`SystemError`:"
-#: ../../c-api/unicode.rst:373
+#: ../../c-api/unicode.rst:374
msgid "*size* < 0,"
-msgstr ""
+msgstr "*size* < 0,"
-#: ../../c-api/unicode.rst:374
+#: ../../c-api/unicode.rst:375
msgid "*str* is ``NULL`` and *size* > 0"
-msgstr ""
+msgstr "*str* 為 ``NULL`` 且 *size* > 0"
-#: ../../c-api/unicode.rst:376
+#: ../../c-api/unicode.rst:377
msgid "*str* == ``NULL`` with *size* > 0 is not allowed anymore."
-msgstr ""
+msgstr "*str* == ``NULL`` 且 *size* > 0 不再被允許。"
-#: ../../c-api/unicode.rst:382
+#: ../../c-api/unicode.rst:383
msgid ""
"Create a Unicode object from a UTF-8 encoded null-terminated char buffer "
"*str*."
msgstr ""
-#: ../../c-api/unicode.rst:388
+#: ../../c-api/unicode.rst:389
msgid ""
"Take a C :c:func:`printf`\\ -style *format* string and a variable number of "
"arguments, calculate the size of the resulting Python Unicode string and "
@@ -414,31 +418,31 @@ msgid ""
"*format* ASCII-encoded string."
msgstr ""
-#: ../../c-api/unicode.rst:394
+#: ../../c-api/unicode.rst:395
msgid ""
"A conversion specifier contains two or more characters and has the following "
"components, which must occur in this order:"
msgstr ""
-#: ../../c-api/unicode.rst:397
+#: ../../c-api/unicode.rst:398
msgid "The ``'%'`` character, which marks the start of the specifier."
msgstr ""
-#: ../../c-api/unicode.rst:399
+#: ../../c-api/unicode.rst:400
msgid ""
"Conversion flags (optional), which affect the result of some conversion "
"types."
msgstr ""
-#: ../../c-api/unicode.rst:402
+#: ../../c-api/unicode.rst:403
msgid ""
"Minimum field width (optional). If specified as an ``'*'`` (asterisk), the "
-"actual width is given in the next argument, which must be of "
-"type :c:expr:`int`, and the object to convert comes after the minimum field "
-"width and optional precision."
+"actual width is given in the next argument, which must be of type :c:expr:"
+"`int`, and the object to convert comes after the minimum field width and "
+"optional precision."
msgstr ""
-#: ../../c-api/unicode.rst:407
+#: ../../c-api/unicode.rst:408
msgid ""
"Precision (optional), given as a ``'.'`` (dot) followed by the precision. If "
"specified as ``'*'`` (an asterisk), the actual precision is given in the "
@@ -446,316 +450,316 @@ msgid ""
"comes after the precision."
msgstr ""
-#: ../../c-api/unicode.rst:412
+#: ../../c-api/unicode.rst:413
msgid "Length modifier (optional)."
msgstr ""
-#: ../../c-api/unicode.rst:414
+#: ../../c-api/unicode.rst:415
msgid "Conversion type."
msgstr ""
-#: ../../c-api/unicode.rst:416
+#: ../../c-api/unicode.rst:417
msgid "The conversion flag characters are:"
msgstr ""
-#: ../../c-api/unicode.rst:421
+#: ../../c-api/unicode.rst:422
msgid "Flag"
msgstr "旗標"
-#: ../../c-api/unicode.rst:421
+#: ../../c-api/unicode.rst:422
msgid "Meaning"
msgstr "含義"
-#: ../../c-api/unicode.rst:423
+#: ../../c-api/unicode.rst:424
msgid "``0``"
msgstr "``0``"
-#: ../../c-api/unicode.rst:423
+#: ../../c-api/unicode.rst:424
msgid "The conversion will be zero padded for numeric values."
msgstr ""
-#: ../../c-api/unicode.rst:425
+#: ../../c-api/unicode.rst:426
msgid "``-``"
msgstr "``-``"
-#: ../../c-api/unicode.rst:425
+#: ../../c-api/unicode.rst:426
msgid ""
"The converted value is left adjusted (overrides the ``0`` flag if both are "
"given)."
msgstr ""
-#: ../../c-api/unicode.rst:429
+#: ../../c-api/unicode.rst:430
msgid ""
"The length modifiers for following integer conversions (``d``, ``i``, ``o``, "
"``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by "
"default):"
msgstr ""
-#: ../../c-api/unicode.rst:436
+#: ../../c-api/unicode.rst:437
msgid "Modifier"
msgstr ""
-#: ../../c-api/unicode.rst:436
+#: ../../c-api/unicode.rst:437
msgid "Types"
msgstr ""
-#: ../../c-api/unicode.rst:438
+#: ../../c-api/unicode.rst:439
msgid "``l``"
msgstr "``l``"
-#: ../../c-api/unicode.rst:438
+#: ../../c-api/unicode.rst:439
msgid ":c:expr:`long` or :c:expr:`unsigned long`"
msgstr ":c:expr:`long` 或 :c:expr:`unsigned long`"
-#: ../../c-api/unicode.rst:440
+#: ../../c-api/unicode.rst:441
msgid "``ll``"
msgstr "``ll``"
-#: ../../c-api/unicode.rst:440
+#: ../../c-api/unicode.rst:441
msgid ":c:expr:`long long` or :c:expr:`unsigned long long`"
msgstr ":c:expr:`long long` 或 :c:expr:`unsigned long long`"
-#: ../../c-api/unicode.rst:442
+#: ../../c-api/unicode.rst:443
msgid "``j``"
msgstr "``j``"
-#: ../../c-api/unicode.rst:442
+#: ../../c-api/unicode.rst:443
msgid ":c:type:`intmax_t` or :c:type:`uintmax_t`"
msgstr ":c:type:`intmax_t` 或 :c:type:`uintmax_t`"
-#: ../../c-api/unicode.rst:444
+#: ../../c-api/unicode.rst:445
msgid "``z``"
msgstr "``z``"
-#: ../../c-api/unicode.rst:444
+#: ../../c-api/unicode.rst:445
msgid ":c:type:`size_t` or :c:type:`ssize_t`"
msgstr ":c:type:`size_t` 或 :c:type:`ssize_t`"
-#: ../../c-api/unicode.rst:446
+#: ../../c-api/unicode.rst:447
msgid "``t``"
msgstr "``t``"
-#: ../../c-api/unicode.rst:446
+#: ../../c-api/unicode.rst:447
msgid ":c:type:`ptrdiff_t`"
msgstr ":c:type:`ptrdiff_t`"
-#: ../../c-api/unicode.rst:449
+#: ../../c-api/unicode.rst:450
msgid ""
"The length modifier ``l`` for following conversions ``s`` or ``V`` specify "
"that the type of the argument is :c:expr:`const wchar_t*`."
msgstr ""
-#: ../../c-api/unicode.rst:452
+#: ../../c-api/unicode.rst:453
msgid "The conversion specifiers are:"
msgstr ""
-#: ../../c-api/unicode.rst:458
+#: ../../c-api/unicode.rst:459
msgid "Conversion Specifier"
msgstr ""
-#: ../../c-api/unicode.rst:459
+#: ../../c-api/unicode.rst:460
msgid "Type"
msgstr ""
-#: ../../c-api/unicode.rst:460
+#: ../../c-api/unicode.rst:461
msgid "Comment"
msgstr ""
-#: ../../c-api/unicode.rst:462
+#: ../../c-api/unicode.rst:463
msgid "``%``"
msgstr "``%``"
-#: ../../c-api/unicode.rst:463
+#: ../../c-api/unicode.rst:464
msgid "*n/a*"
msgstr "*n/a*"
-#: ../../c-api/unicode.rst:464
+#: ../../c-api/unicode.rst:465
msgid "The literal ``%`` character."
msgstr "字面 ``%`` 字元。"
-#: ../../c-api/unicode.rst:466
+#: ../../c-api/unicode.rst:467
msgid "``d``, ``i``"
msgstr "``d``, ``i``"
-#: ../../c-api/unicode.rst:467 ../../c-api/unicode.rst:471
-#: ../../c-api/unicode.rst:475 ../../c-api/unicode.rst:479
-#: ../../c-api/unicode.rst:483
+#: ../../c-api/unicode.rst:468 ../../c-api/unicode.rst:472
+#: ../../c-api/unicode.rst:476 ../../c-api/unicode.rst:480
+#: ../../c-api/unicode.rst:484
msgid "Specified by the length modifier"
msgstr ""
-#: ../../c-api/unicode.rst:468
+#: ../../c-api/unicode.rst:469
msgid "The decimal representation of a signed C integer."
msgstr "一個有符號 C 整數的十進位表示法。"
-#: ../../c-api/unicode.rst:470
+#: ../../c-api/unicode.rst:471
msgid "``u``"
msgstr "``u``"
-#: ../../c-api/unicode.rst:472
+#: ../../c-api/unicode.rst:473
msgid "The decimal representation of an unsigned C integer."
msgstr "一個無符號 C 整數的十進位表示法。"
-#: ../../c-api/unicode.rst:474
+#: ../../c-api/unicode.rst:475
msgid "``o``"
msgstr "``o``"
-#: ../../c-api/unicode.rst:476
+#: ../../c-api/unicode.rst:477
msgid "The octal representation of an unsigned C integer."
msgstr "一個無符號 C 整數的八進位表示法。"
-#: ../../c-api/unicode.rst:478
+#: ../../c-api/unicode.rst:479
msgid "``x``"
msgstr "``x``"
-#: ../../c-api/unicode.rst:480
+#: ../../c-api/unicode.rst:481
msgid "The hexadecimal representation of an unsigned C integer (lowercase)."
msgstr "一個無符號 C 整數的十六進位表示法(小寫)。"
-#: ../../c-api/unicode.rst:482
+#: ../../c-api/unicode.rst:483
msgid "``X``"
msgstr "``X``"
-#: ../../c-api/unicode.rst:484
+#: ../../c-api/unicode.rst:485
msgid "The hexadecimal representation of an unsigned C integer (uppercase)."
msgstr "一個無符號 C 整數的十六進位表示法(大寫)。"
-#: ../../c-api/unicode.rst:486
+#: ../../c-api/unicode.rst:487
msgid "``c``"
msgstr "``c``"
-#: ../../c-api/unicode.rst:487
+#: ../../c-api/unicode.rst:488
msgid ":c:expr:`int`"
msgstr ":c:expr:`int`"
-#: ../../c-api/unicode.rst:488
+#: ../../c-api/unicode.rst:489
msgid "A single character."
msgstr "一個單一字元。"
-#: ../../c-api/unicode.rst:490
+#: ../../c-api/unicode.rst:491
msgid "``s``"
msgstr "``s``"
-#: ../../c-api/unicode.rst:491
+#: ../../c-api/unicode.rst:492
msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`"
msgstr ":c:expr:`const char*` 或 :c:expr:`const wchar_t*`"
-#: ../../c-api/unicode.rst:492
+#: ../../c-api/unicode.rst:493
msgid "A null-terminated C character array."
msgstr "一個以 null 結尾的 C 字元陣列。"
-#: ../../c-api/unicode.rst:494
+#: ../../c-api/unicode.rst:495
msgid "``p``"
msgstr "``p``"
-#: ../../c-api/unicode.rst:495
+#: ../../c-api/unicode.rst:496
msgid ":c:expr:`const void*`"
msgstr ":c:expr:`const void*`"
-#: ../../c-api/unicode.rst:496
+#: ../../c-api/unicode.rst:497
msgid ""
"The hex representation of a C pointer. Mostly equivalent to "
"``printf(\"%p\")`` except that it is guaranteed to start with the literal "
"``0x`` regardless of what the platform's ``printf`` yields."
msgstr ""
-#: ../../c-api/unicode.rst:501
+#: ../../c-api/unicode.rst:502
msgid "``A``"
msgstr "``A``"
-#: ../../c-api/unicode.rst:502 ../../c-api/unicode.rst:506
-#: ../../c-api/unicode.rst:516 ../../c-api/unicode.rst:520
-#: ../../c-api/unicode.rst:524 ../../c-api/unicode.rst:529
+#: ../../c-api/unicode.rst:503 ../../c-api/unicode.rst:507
+#: ../../c-api/unicode.rst:517 ../../c-api/unicode.rst:521
+#: ../../c-api/unicode.rst:525 ../../c-api/unicode.rst:530
msgid ":c:expr:`PyObject*`"
msgstr ":c:expr:`PyObject*`"
-#: ../../c-api/unicode.rst:503
+#: ../../c-api/unicode.rst:504
msgid "The result of calling :func:`ascii`."
msgstr "呼叫 :func:`ascii` 的結果。"
-#: ../../c-api/unicode.rst:505
+#: ../../c-api/unicode.rst:506
msgid "``U``"
msgstr "``U``"
-#: ../../c-api/unicode.rst:507
+#: ../../c-api/unicode.rst:508
msgid "A Unicode object."
msgstr "一個 Unicode 物件。"
-#: ../../c-api/unicode.rst:509
+#: ../../c-api/unicode.rst:510
msgid "``V``"
msgstr "``V``"
-#: ../../c-api/unicode.rst:510
+#: ../../c-api/unicode.rst:511
msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`"
msgstr ":c:expr:`PyObject*`、:c:expr:`const char*` 或 :c:expr:`const wchar_t*`"
-#: ../../c-api/unicode.rst:511
+#: ../../c-api/unicode.rst:512
msgid ""
"A Unicode object (which may be ``NULL``) and a null-terminated C character "
"array as a second parameter (which will be used, if the first parameter is "
"``NULL``)."
msgstr ""
-#: ../../c-api/unicode.rst:515
+#: ../../c-api/unicode.rst:516
msgid "``S``"
msgstr "``S``"
-#: ../../c-api/unicode.rst:517
+#: ../../c-api/unicode.rst:518
msgid "The result of calling :c:func:`PyObject_Str`."
msgstr "呼叫 :c:func:`PyObject_Str` 的結果。"
-#: ../../c-api/unicode.rst:519
+#: ../../c-api/unicode.rst:520
msgid "``R``"
msgstr "``R``"
-#: ../../c-api/unicode.rst:521
+#: ../../c-api/unicode.rst:522
msgid "The result of calling :c:func:`PyObject_Repr`."
msgstr "呼叫 :c:func:`PyObject_Repr` 的結果。"
-#: ../../c-api/unicode.rst:523
+#: ../../c-api/unicode.rst:524
msgid "``T``"
msgstr "``T``"
-#: ../../c-api/unicode.rst:525
+#: ../../c-api/unicode.rst:526
msgid ""
-"Get the fully qualified name of an object type; "
-"call :c:func:`PyType_GetFullyQualifiedName`."
+"Get the fully qualified name of an object type; call :c:func:"
+"`PyType_GetFullyQualifiedName`."
msgstr ""
-#: ../../c-api/unicode.rst:528
+#: ../../c-api/unicode.rst:529
msgid "``#T``"
msgstr "``#T``"
-#: ../../c-api/unicode.rst:530
+#: ../../c-api/unicode.rst:531
msgid ""
"Similar to ``T`` format, but use a colon (``:``) as separator between the "
"module name and the qualified name."
msgstr ""
-#: ../../c-api/unicode.rst:533
+#: ../../c-api/unicode.rst:534
msgid "``N``"
msgstr "``N``"
-#: ../../c-api/unicode.rst:534 ../../c-api/unicode.rst:539
+#: ../../c-api/unicode.rst:535 ../../c-api/unicode.rst:540
msgid ":c:expr:`PyTypeObject*`"
msgstr ":c:expr:`PyTypeObject*`"
-#: ../../c-api/unicode.rst:535
+#: ../../c-api/unicode.rst:536
msgid ""
-"Get the fully qualified name of a type; "
-"call :c:func:`PyType_GetFullyQualifiedName`."
+"Get the fully qualified name of a type; call :c:func:"
+"`PyType_GetFullyQualifiedName`."
msgstr ""
-#: ../../c-api/unicode.rst:538
+#: ../../c-api/unicode.rst:539
msgid "``#N``"
msgstr "``#N``"
-#: ../../c-api/unicode.rst:540
+#: ../../c-api/unicode.rst:541
msgid ""
"Similar to ``N`` format, but use a colon (``:``) as separator between the "
"module name and the qualified name."
msgstr ""
-#: ../../c-api/unicode.rst:544
+#: ../../c-api/unicode.rst:545
msgid ""
"The width formatter unit is number of characters rather than bytes. The "
"precision formatter unit is number of bytes or :c:type:`wchar_t` items (if "
@@ -765,22 +769,22 @@ msgid ""
"``PyObject*`` argument is not ``NULL``)."
msgstr ""
-#: ../../c-api/unicode.rst:552
+#: ../../c-api/unicode.rst:553
msgid ""
"Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision "
"is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or "
"``X``)."
msgstr ""
-#: ../../c-api/unicode.rst:556
+#: ../../c-api/unicode.rst:557
msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added."
msgstr "新增對 ``\"%lld\"`` 和 ``\"%llu\"`` 的支援。"
-#: ../../c-api/unicode.rst:559
+#: ../../c-api/unicode.rst:560
msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added."
msgstr "新增對 ``\"%li\"``、``\"%lli\"`` 和 ``\"%zi\"`` 的支援。"
-#: ../../c-api/unicode.rst:562
+#: ../../c-api/unicode.rst:563
msgid ""
"Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, "
"``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added."
@@ -788,7 +792,7 @@ msgstr ""
"新增對 ``\"%s\"``、``\"%A\"``、``\"%U\"``、``\"%V\"``、``\"%S\"``、"
"``\"%R\"`` 的寬度和精確度格式化支援。"
-#: ../../c-api/unicode.rst:566
+#: ../../c-api/unicode.rst:567
msgid ""
"Support for conversion specifiers ``o`` and ``X``. Support for length "
"modifiers ``j`` and ``t``. Length modifiers are now applied to all integer "
@@ -797,68 +801,90 @@ msgid ""
"flag ``-``."
msgstr ""
-#: ../../c-api/unicode.rst:574
+#: ../../c-api/unicode.rst:575
msgid ""
"An unrecognized format character now sets a :exc:`SystemError`. In previous "
"versions it caused all the rest of the format string to be copied as-is to "
"the result string, and any extra arguments discarded."
msgstr ""
-#: ../../c-api/unicode.rst:578
+#: ../../c-api/unicode.rst:579
msgid "Support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats added."
msgstr "新增對 ``%T``、``%#T``、``%N`` 和 ``%#N`` 格式的支援。"
-#: ../../c-api/unicode.rst:584
+#: ../../c-api/unicode.rst:585
msgid ""
"Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two "
"arguments."
msgstr ""
-#: ../../c-api/unicode.rst:590
+#: ../../c-api/unicode.rst:591
msgid ""
"Copy an instance of a Unicode subtype to a new true Unicode object if "
"necessary. If *obj* is already a true Unicode object (not a subtype), return "
"a new :term:`strong reference` to the object."
msgstr ""
-#: ../../c-api/unicode.rst:594
+#: ../../c-api/unicode.rst:595
msgid ""
"Objects other than Unicode or its subtypes will cause a :exc:`TypeError`."
msgstr ""
#: ../../c-api/unicode.rst:600
-msgid "Decode an encoded object *obj* to a Unicode object."
+msgid "Create a Unicode Object from the given Unicode code point *ordinal*."
msgstr ""
#: ../../c-api/unicode.rst:602
msgid ""
+"The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is raised in "
+"the case it is not."
+msgstr ""
+
+#: ../../c-api/unicode.rst:609
+msgid "Decode an encoded object *obj* to a Unicode object."
+msgstr ""
+
+#: ../../c-api/unicode.rst:611
+msgid ""
":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects "
"` are decoded according to the given *encoding* and using "
"the error handling defined by *errors*. Both can be ``NULL`` to have the "
"interface use the default values (see :ref:`builtincodecs` for details)."
msgstr ""
-#: ../../c-api/unicode.rst:608
+#: ../../c-api/unicode.rst:617
msgid ""
"All other objects, including Unicode objects, cause a :exc:`TypeError` to be "
"set."
msgstr ""
-#: ../../c-api/unicode.rst:611
+#: ../../c-api/unicode.rst:620
msgid ""
"The API returns ``NULL`` if there was an error. The caller is responsible "
"for decref'ing the returned objects."
msgstr ""
-#: ../../c-api/unicode.rst:617
+#: ../../c-api/unicode.rst:626
+msgid ""
+"Return the name of the default string encoding, ``\"utf-8\"``. See :func:"
+"`sys.getdefaultencoding`."
+msgstr ""
+
+#: ../../c-api/unicode.rst:629
+msgid ""
+"The returned string does not need to be freed, and is valid until "
+"interpreter shutdown."
+msgstr ""
+
+#: ../../c-api/unicode.rst:635
msgid "Return the length of the Unicode object, in code points."
msgstr ""
-#: ../../c-api/unicode.rst:619
+#: ../../c-api/unicode.rst:637
msgid "On error, set an exception and return ``-1``."
msgstr "發生錯誤時,設定例外並回傳 ``-1``。"
-#: ../../c-api/unicode.rst:630
+#: ../../c-api/unicode.rst:648
msgid ""
"Copy characters from one Unicode object into another. This function "
"performs character conversion when necessary and falls back to :c:func:`!"
@@ -866,61 +892,61 @@ msgid ""
"otherwise returns the number of copied characters."
msgstr ""
-#: ../../c-api/unicode.rst:641
+#: ../../c-api/unicode.rst:659
msgid ""
-"Fill a string with a character: write *fill_char* into "
-"``unicode[start:start+length]``."
+"Fill a string with a character: write *fill_char* into ``unicode[start:"
+"start+length]``."
msgstr ""
-#: ../../c-api/unicode.rst:644
+#: ../../c-api/unicode.rst:662
msgid ""
"Fail if *fill_char* is bigger than the string maximum character, or if the "
"string has more than 1 reference."
msgstr ""
-#: ../../c-api/unicode.rst:647
+#: ../../c-api/unicode.rst:665
msgid ""
"Return the number of written character, or return ``-1`` and raise an "
"exception on error."
msgstr ""
-#: ../../c-api/unicode.rst:656
+#: ../../c-api/unicode.rst:674
msgid ""
-"Write a character to a string. The string must have been created "
-"through :c:func:`PyUnicode_New`. Since Unicode strings are supposed to be "
-"immutable, the string must not be shared, or have been hashed yet."
+"Write a character to a string. The string must have been created through :c:"
+"func:`PyUnicode_New`. Since Unicode strings are supposed to be immutable, "
+"the string must not be shared, or have been hashed yet."
msgstr ""
-#: ../../c-api/unicode.rst:660
+#: ../../c-api/unicode.rst:678
msgid ""
"This function checks that *unicode* is a Unicode object, that the index is "
"not out of bounds, and that the object can be modified safely (i.e. that it "
"its reference count is one)."
msgstr ""
-#: ../../c-api/unicode.rst:664
+#: ../../c-api/unicode.rst:682
msgid "Return ``0`` on success, ``-1`` on error with an exception set."
msgstr "成功時回傳 ``0``,發生錯誤時設定例外並回傳 ``-1``。"
-#: ../../c-api/unicode.rst:671
+#: ../../c-api/unicode.rst:689
msgid ""
"Read a character from a string. This function checks that *unicode* is a "
-"Unicode object and the index is not out of bounds, in contrast "
-"to :c:func:`PyUnicode_READ_CHAR`, which performs no error checking."
+"Unicode object and the index is not out of bounds, in contrast to :c:func:"
+"`PyUnicode_READ_CHAR`, which performs no error checking."
msgstr ""
-#: ../../c-api/unicode.rst:675
+#: ../../c-api/unicode.rst:693
msgid "Return character on success, ``-1`` on error with an exception set."
msgstr "成功時回傳字元,發生錯誤時設定例外並回傳 ``-1``。"
-#: ../../c-api/unicode.rst:683
+#: ../../c-api/unicode.rst:701
msgid ""
"Return a substring of *unicode*, from character index *start* (included) to "
"character index *end* (excluded). Negative indices are not supported. On "
"error, set an exception and return ``NULL``."
msgstr ""
-#: ../../c-api/unicode.rst:693
+#: ../../c-api/unicode.rst:711
msgid ""
"Copy the string *unicode* into a UCS4 buffer, including a null character, if "
"*copy_null* is set. Returns ``NULL`` and sets an exception on error (in "
@@ -928,25 +954,25 @@ msgid ""
"*unicode*). *buffer* is returned on success."
msgstr ""
-#: ../../c-api/unicode.rst:703
+#: ../../c-api/unicode.rst:721
msgid ""
-"Copy the string *unicode* into a new UCS4 buffer that is allocated "
-"using :c:func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with "
-"a :exc:`MemoryError` set. The returned buffer always has an extra null code "
-"point appended."
+"Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:"
+"func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:"
+"`MemoryError` set. The returned buffer always has an extra null code point "
+"appended."
msgstr ""
-#: ../../c-api/unicode.rst:712
+#: ../../c-api/unicode.rst:730
msgid "Locale Encoding"
msgstr ""
-#: ../../c-api/unicode.rst:714
+#: ../../c-api/unicode.rst:732
msgid ""
"The current locale encoding can be used to decode text from the operating "
"system."
msgstr ""
-#: ../../c-api/unicode.rst:721
+#: ../../c-api/unicode.rst:739
msgid ""
"Decode a string from UTF-8 on Android and VxWorks, or from the current "
"locale encoding on other platforms. The supported error handlers are "
@@ -955,29 +981,29 @@ msgid ""
"null character but cannot contain embedded null characters."
msgstr ""
-#: ../../c-api/unicode.rst:728
+#: ../../c-api/unicode.rst:746
msgid ""
-"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from "
-"the :term:`filesystem encoding and error handler`."
+"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :"
+"term:`filesystem encoding and error handler`."
msgstr ""
-#: ../../c-api/unicode.rst:731 ../../c-api/unicode.rst:766
+#: ../../c-api/unicode.rst:749 ../../c-api/unicode.rst:784
msgid "This function ignores the :ref:`Python UTF-8 Mode `."
msgstr "此函式會忽略 :ref:`Python UTF-8 模式 `。"
-#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:851
+#: ../../c-api/unicode.rst:753 ../../c-api/unicode.rst:869
msgid "The :c:func:`Py_DecodeLocale` function."
msgstr ":c:func:`Py_DecodeLocale` 函式。"
-#: ../../c-api/unicode.rst:739
+#: ../../c-api/unicode.rst:757
msgid ""
"The function now also uses the current locale encoding for the "
-"``surrogateescape`` error handler, except on Android. "
-"Previously, :c:func:`Py_DecodeLocale` was used for the ``surrogateescape``, "
-"and the current locale encoding was used for ``strict``."
+"``surrogateescape`` error handler, except on Android. Previously, :c:func:"
+"`Py_DecodeLocale` was used for the ``surrogateescape``, and the current "
+"locale encoding was used for ``strict``."
msgstr ""
-#: ../../c-api/unicode.rst:748
+#: ../../c-api/unicode.rst:766
msgid ""
"Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string "
"length using :c:func:`!strlen`."
@@ -985,55 +1011,55 @@ msgstr ""
"類似於 :c:func:`PyUnicode_DecodeLocaleAndSize`,但使用 :c:func:`!strlen` 計算"
"字串長度。"
-#: ../../c-api/unicode.rst:756
+#: ../../c-api/unicode.rst:774
msgid ""
"Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current "
"locale encoding on other platforms. The supported error handlers are "
"``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The encoder uses "
-"``\"strict\"`` error handler if *errors* is ``NULL``. Return "
-"a :class:`bytes` object. *unicode* cannot contain embedded null characters."
+"``\"strict\"`` error handler if *errors* is ``NULL``. Return a :class:"
+"`bytes` object. *unicode* cannot contain embedded null characters."
msgstr ""
-#: ../../c-api/unicode.rst:763
+#: ../../c-api/unicode.rst:781
msgid ""
-"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to "
-"the :term:`filesystem encoding and error handler`."
+"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:"
+"`filesystem encoding and error handler`."
msgstr ""
-#: ../../c-api/unicode.rst:770 ../../c-api/unicode.rst:882
+#: ../../c-api/unicode.rst:788 ../../c-api/unicode.rst:900
msgid "The :c:func:`Py_EncodeLocale` function."
msgstr ":c:func:`Py_EncodeLocale` 函式。"
-#: ../../c-api/unicode.rst:774
+#: ../../c-api/unicode.rst:792
msgid ""
"The function now also uses the current locale encoding for the "
-"``surrogateescape`` error handler, except on Android. "
-"Previously, :c:func:`Py_EncodeLocale` was used for the ``surrogateescape``, "
-"and the current locale encoding was used for ``strict``."
+"``surrogateescape`` error handler, except on Android. Previously, :c:func:"
+"`Py_EncodeLocale` was used for the ``surrogateescape``, and the current "
+"locale encoding was used for ``strict``."
msgstr ""
-#: ../../c-api/unicode.rst:783
+#: ../../c-api/unicode.rst:801
msgid "File System Encoding"
msgstr "檔案系統編碼"
-#: ../../c-api/unicode.rst:785
+#: ../../c-api/unicode.rst:803
msgid ""
"Functions encoding to and decoding from the :term:`filesystem encoding and "
"error handler` (:pep:`383` and :pep:`529`)."
msgstr ""
-#: ../../c-api/unicode.rst:788
+#: ../../c-api/unicode.rst:806
msgid ""
"To encode file names to :class:`bytes` during argument parsing, the "
"``\"O&\"`` converter should be used, passing :c:func:`!"
"PyUnicode_FSConverter` as the conversion function:"
msgstr ""
-#: ../../c-api/unicode.rst:794
+#: ../../c-api/unicode.rst:812
msgid ""
":ref:`PyArg_Parse\\* converter `: encode :class:`str` objects "
-"-- obtained directly or through the :class:`os.PathLike` interface -- "
-"to :class:`bytes` using :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` "
+"-- obtained directly or through the :class:`os.PathLike` interface -- to :"
+"class:`bytes` using :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` "
"objects are output as-is. *result* must be an address of a C variable of "
"type :c:expr:`PyObject*` (or :c:expr:`PyBytesObject*`). On success, set the "
"variable to a new :term:`strong reference` to a :ref:`bytes object "
@@ -1042,95 +1068,94 @@ msgid ""
"not allowed in the result. On failure, return ``0`` with an exception set."
msgstr ""
-#: ../../c-api/unicode.rst:806
+#: ../../c-api/unicode.rst:824
msgid ""
"If *obj* is ``NULL``, the function releases a strong reference stored in the "
"variable referred by *result* and returns ``1``."
msgstr ""
-#: ../../c-api/unicode.rst:811 ../../c-api/unicode.rst:838
+#: ../../c-api/unicode.rst:829 ../../c-api/unicode.rst:856
msgid "Accepts a :term:`path-like object`."
msgstr "接受一個 :term:`path-like object`。"
-#: ../../c-api/unicode.rst:814
+#: ../../c-api/unicode.rst:832
msgid ""
"To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` "
"converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the "
"conversion function:"
msgstr ""
-#: ../../c-api/unicode.rst:820
+#: ../../c-api/unicode.rst:838
msgid ""
":ref:`PyArg_Parse\\* converter `: decode :class:`bytes` objects "
"-- obtained either directly or indirectly through the :class:`os.PathLike` "
-"interface -- to :class:`str` "
-"using :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are "
-"output as-is. *result* must be an address of a C variable of "
-"type :c:expr:`PyObject*` (or :c:expr:`PyUnicodeObject*`). On success, set "
-"the variable to a new :term:`strong reference` to a :ref:`Unicode object "
-"` which must be released when it is no longer used and "
-"return a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null "
-"characters are not allowed in the result. On failure, return ``0`` with an "
-"exception set."
+"interface -- to :class:`str` using :c:func:"
+"`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are output as-is. "
+"*result* must be an address of a C variable of type :c:expr:`PyObject*` (or :"
+"c:expr:`PyUnicodeObject*`). On success, set the variable to a new :term:"
+"`strong reference` to a :ref:`Unicode object ` which must be "
+"released when it is no longer used and return a non-zero value (:c:macro:"
+"`Py_CLEANUP_SUPPORTED`). Embedded null characters are not allowed in the "
+"result. On failure, return ``0`` with an exception set."
msgstr ""
-#: ../../c-api/unicode.rst:833
+#: ../../c-api/unicode.rst:851
msgid ""
"If *obj* is ``NULL``, release the strong reference to the object referred to "
"by *result* and return ``1``."
msgstr ""
-#: ../../c-api/unicode.rst:844
+#: ../../c-api/unicode.rst:862
msgid "Decode a string from the :term:`filesystem encoding and error handler`."
msgstr ""
-#: ../../c-api/unicode.rst:846
+#: ../../c-api/unicode.rst:864
msgid ""
-"If you need to decode a string from the current locale encoding, "
-"use :c:func:`PyUnicode_DecodeLocaleAndSize`."
+"If you need to decode a string from the current locale encoding, use :c:func:"
+"`PyUnicode_DecodeLocaleAndSize`."
msgstr ""
-#: ../../c-api/unicode.rst:853 ../../c-api/unicode.rst:866
-#: ../../c-api/unicode.rst:886
+#: ../../c-api/unicode.rst:871 ../../c-api/unicode.rst:884
+#: ../../c-api/unicode.rst:904
msgid ""
"The :term:`filesystem error handler ` "
"is now used."
msgstr ""
-#: ../../c-api/unicode.rst:860
+#: ../../c-api/unicode.rst:878
msgid ""
"Decode a null-terminated string from the :term:`filesystem encoding and "
"error handler`."
msgstr ""
-#: ../../c-api/unicode.rst:863
+#: ../../c-api/unicode.rst:881
msgid ""
-"If the string length is known, "
-"use :c:func:`PyUnicode_DecodeFSDefaultAndSize`."
+"If the string length is known, use :c:func:"
+"`PyUnicode_DecodeFSDefaultAndSize`."
msgstr "如果字串長度已知,請使用 :c:func:`PyUnicode_DecodeFSDefaultAndSize`。"
-#: ../../c-api/unicode.rst:873
+#: ../../c-api/unicode.rst:891
msgid ""
"Encode a Unicode object to the :term:`filesystem encoding and error "
"handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` "
"object can contain null bytes."
msgstr ""
-#: ../../c-api/unicode.rst:877
+#: ../../c-api/unicode.rst:895
msgid ""
-"If you need to encode a string to the current locale encoding, "
-"use :c:func:`PyUnicode_EncodeLocale`."
+"If you need to encode a string to the current locale encoding, use :c:func:"
+"`PyUnicode_EncodeLocale`."
msgstr ""
-#: ../../c-api/unicode.rst:891
+#: ../../c-api/unicode.rst:909
msgid "wchar_t Support"
msgstr "wchar_t 支援"
-#: ../../c-api/unicode.rst:893
+#: ../../c-api/unicode.rst:911
msgid ":c:type:`wchar_t` support for platforms which support it:"
msgstr "對支援 :c:type:`wchar_t` 的平台提供支援:"
-#: ../../c-api/unicode.rst:897
+#: ../../c-api/unicode.rst:915
msgid ""
"Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the "
"given *size*. Passing ``-1`` as the *size* indicates that the function must "
@@ -1138,73 +1163,72 @@ msgid ""
"failure."
msgstr ""
-#: ../../c-api/unicode.rst:905
+#: ../../c-api/unicode.rst:923
msgid ""
"Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. "
"At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly "
-"trailing null termination character). Return the number "
-"of :c:type:`wchar_t` characters copied or ``-1`` in case of an error."
+"trailing null termination character). Return the number of :c:type:"
+"`wchar_t` characters copied or ``-1`` in case of an error."
msgstr ""
-#: ../../c-api/unicode.rst:910
+#: ../../c-api/unicode.rst:928
msgid ""
"When *wstr* is ``NULL``, instead return the *size* that would be required to "
"store all of *unicode* including a terminating null."
msgstr ""
-#: ../../c-api/unicode.rst:913
+#: ../../c-api/unicode.rst:931
msgid ""
"Note that the resulting :c:expr:`wchar_t*` string may or may not be null-"
-"terminated. It is the responsibility of the caller to make sure that "
-"the :c:expr:`wchar_t*` string is null-terminated in case this is required by "
-"the application. Also, note that the :c:expr:`wchar_t*` string might contain "
+"terminated. It is the responsibility of the caller to make sure that the :c:"
+"expr:`wchar_t*` string is null-terminated in case this is required by the "
+"application. Also, note that the :c:expr:`wchar_t*` string might contain "
"null characters, which would cause the string to be truncated when used with "
"most C functions."
msgstr ""
-#: ../../c-api/unicode.rst:923
+#: ../../c-api/unicode.rst:941
msgid ""
"Convert the Unicode object to a wide character string. The output string "
"always ends with a null character. If *size* is not ``NULL``, write the "
"number of wide characters (excluding the trailing null termination "
"character) into *\\*size*. Note that the resulting :c:type:`wchar_t` string "
"might contain null characters, which would cause the string to be truncated "
-"when used with most C functions. If *size* is ``NULL`` and "
-"the :c:expr:`wchar_t*` string contains null characters a :exc:`ValueError` "
-"is raised."
+"when used with most C functions. If *size* is ``NULL`` and the :c:expr:"
+"`wchar_t*` string contains null characters a :exc:`ValueError` is raised."
msgstr ""
-#: ../../c-api/unicode.rst:931
+#: ../../c-api/unicode.rst:949
msgid ""
"Returns a buffer allocated by :c:macro:`PyMem_New` (use :c:func:`PyMem_Free` "
"to free it) on success. On error, returns ``NULL`` and *\\*size* is "
"undefined. Raises a :exc:`MemoryError` if memory allocation is failed."
msgstr ""
-#: ../../c-api/unicode.rst:938
+#: ../../c-api/unicode.rst:956
msgid ""
"Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` "
"string contains null characters."
msgstr ""
-#: ../../c-api/unicode.rst:946
+#: ../../c-api/unicode.rst:964
msgid "Built-in Codecs"
msgstr "內建編解碼器"
-#: ../../c-api/unicode.rst:948
+#: ../../c-api/unicode.rst:966
msgid ""
"Python provides a set of built-in codecs which are written in C for speed. "
"All of these codecs are directly usable via the following functions."
msgstr ""
-#: ../../c-api/unicode.rst:951
+#: ../../c-api/unicode.rst:969
msgid ""
"Many of the following APIs take two arguments encoding and errors, and they "
"have the same semantics as the ones of the built-in :func:`str` string "
"object constructor."
msgstr ""
-#: ../../c-api/unicode.rst:955
+#: ../../c-api/unicode.rst:973
msgid ""
"Setting encoding to ``NULL`` causes the default encoding to be used which is "
"UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for "
@@ -1212,28 +1236,28 @@ msgid ""
"handler` internally."
msgstr ""
-#: ../../c-api/unicode.rst:960
+#: ../../c-api/unicode.rst:978
msgid ""
"Error handling is set by errors which may also be set to ``NULL`` meaning to "
"use the default handling defined for the codec. Default error handling for "
"all built-in codecs is \"strict\" (:exc:`ValueError` is raised)."
msgstr ""
-#: ../../c-api/unicode.rst:964
+#: ../../c-api/unicode.rst:982
msgid ""
"The codecs all use a similar interface. Only deviations from the following "
"generic ones are documented for simplicity."
msgstr ""
-#: ../../c-api/unicode.rst:969
+#: ../../c-api/unicode.rst:987
msgid "Generic Codecs"
msgstr "泛用編解碼器"
-#: ../../c-api/unicode.rst:971
+#: ../../c-api/unicode.rst:989
msgid "These are the generic codec APIs:"
msgstr "這些是泛用編解碼器的 API:"
-#: ../../c-api/unicode.rst:977
+#: ../../c-api/unicode.rst:995
msgid ""
"Create a Unicode object by decoding *size* bytes of the encoded string "
"*str*. *encoding* and *errors* have the same meaning as the parameters of "
@@ -1242,7 +1266,7 @@ msgid ""
"was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:987
+#: ../../c-api/unicode.rst:1005
msgid ""
"Encode a Unicode object and return the result as Python bytes object. "
"*encoding* and *errors* have the same meaning as the parameters of the same "
@@ -1251,21 +1275,21 @@ msgid ""
"was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:995
+#: ../../c-api/unicode.rst:1013
msgid "UTF-8 Codecs"
msgstr "UTF-8 編解碼器"
-#: ../../c-api/unicode.rst:997
+#: ../../c-api/unicode.rst:1015
msgid "These are the UTF-8 codec APIs:"
msgstr "這些是 UTF-8 編解碼器的 API:"
-#: ../../c-api/unicode.rst:1002
+#: ../../c-api/unicode.rst:1020
msgid ""
"Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string "
"*str*. Return ``NULL`` if an exception was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1009
+#: ../../c-api/unicode.rst:1027
msgid ""
"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If "
"*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will "
@@ -1273,20 +1297,20 @@ msgid ""
"of bytes that have been decoded will be stored in *consumed*."
msgstr ""
-#: ../../c-api/unicode.rst:1017
+#: ../../c-api/unicode.rst:1035
msgid ""
"Encode a Unicode object using UTF-8 and return the result as Python bytes "
"object. Error handling is \"strict\". Return ``NULL`` if an exception was "
"raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1021 ../../c-api/unicode.rst:1036
+#: ../../c-api/unicode.rst:1039 ../../c-api/unicode.rst:1054
msgid ""
"The function fails if the string contains surrogate code points (``U+D800`` "
"- ``U+DFFF``)."
msgstr ""
-#: ../../c-api/unicode.rst:1027
+#: ../../c-api/unicode.rst:1045
msgid ""
"Return a pointer to the UTF-8 encoding of the Unicode object, and store the "
"size of the encoded representation (in bytes) in *size*. The *size* "
@@ -1295,7 +1319,7 @@ msgid ""
"regardless of whether there are any other null code points."
msgstr ""
-#: ../../c-api/unicode.rst:1033
+#: ../../c-api/unicode.rst:1051
msgid ""
"On error, set an exception, set *size* to ``-1`` (if it's not NULL) and "
"return ``NULL``."
@@ -1303,7 +1327,7 @@ msgstr ""
"發生錯誤時,設定例外並將 *size* 設為 ``-1``\\ (如果不是 NULL),並回傳 "
"``NULL``。"
-#: ../../c-api/unicode.rst:1039
+#: ../../c-api/unicode.rst:1057
msgid ""
"This caches the UTF-8 representation of the string in the Unicode object, "
"and subsequent calls will return a pointer to the same buffer. The caller "
@@ -1312,57 +1336,57 @@ msgid ""
"collected."
msgstr ""
-#: ../../c-api/unicode.rst:1046 ../../c-api/unicode.rst:1068
+#: ../../c-api/unicode.rst:1064 ../../c-api/unicode.rst:1086
msgid "The return type is now ``const char *`` rather of ``char *``."
msgstr "回傳型別現在是 ``const char *`` 而不是 ``char *``。"
-#: ../../c-api/unicode.rst:1049
+#: ../../c-api/unicode.rst:1067
msgid "This function is a part of the :ref:`limited API `."
msgstr ""
-#: ../../c-api/unicode.rst:1055
+#: ../../c-api/unicode.rst:1073
msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size."
msgstr "與 :c:func:`PyUnicode_AsUTF8AndSize` 類似,但不儲存大小。"
-#: ../../c-api/unicode.rst:1059
+#: ../../c-api/unicode.rst:1077
msgid ""
"This function does not have any special behavior for `null characters "
"`_ embedded within *unicode*. "
"As a result, strings containing null characters will remain in the returned "
"string, which some C functions might interpret as the end of the string, "
-"leading to truncation. If truncation is an issue, it is recommended to "
-"use :c:func:`PyUnicode_AsUTF8AndSize` instead."
+"leading to truncation. If truncation is an issue, it is recommended to use :"
+"c:func:`PyUnicode_AsUTF8AndSize` instead."
msgstr ""
-#: ../../c-api/unicode.rst:1073
+#: ../../c-api/unicode.rst:1091
msgid "UTF-32 Codecs"
msgstr "UTF-32 編解碼器"
-#: ../../c-api/unicode.rst:1075
+#: ../../c-api/unicode.rst:1093
msgid "These are the UTF-32 codec APIs:"
msgstr "這些是 UTF-32 編解碼器的 API:"
-#: ../../c-api/unicode.rst:1081
+#: ../../c-api/unicode.rst:1099
msgid ""
"Decode *size* bytes from a UTF-32 encoded buffer string and return the "
"corresponding Unicode object. *errors* (if non-``NULL``) defines the error "
"handling. It defaults to \"strict\"."
msgstr ""
-#: ../../c-api/unicode.rst:1085 ../../c-api/unicode.rst:1135
+#: ../../c-api/unicode.rst:1103 ../../c-api/unicode.rst:1153
msgid ""
"If *byteorder* is non-``NULL``, the decoder starts decoding using the given "
"byte order::"
msgstr ""
-#: ../../c-api/unicode.rst:1088 ../../c-api/unicode.rst:1138
+#: ../../c-api/unicode.rst:1106 ../../c-api/unicode.rst:1156
msgid ""
"*byteorder == -1: little endian\n"
"*byteorder == 0: native order\n"
"*byteorder == 1: big endian"
msgstr ""
-#: ../../c-api/unicode.rst:1092
+#: ../../c-api/unicode.rst:1110
msgid ""
"If ``*byteorder`` is zero, and the first four bytes of the input data are a "
"byte order mark (BOM), the decoder switches to this byte order and the BOM "
@@ -1370,21 +1394,21 @@ msgid ""
"``-1`` or ``1``, any byte order mark is copied to the output."
msgstr ""
-#: ../../c-api/unicode.rst:1097
+#: ../../c-api/unicode.rst:1115
msgid ""
"After completion, *\\*byteorder* is set to the current byte order at the end "
"of input data."
msgstr ""
-#: ../../c-api/unicode.rst:1100 ../../c-api/unicode.rst:1151
+#: ../../c-api/unicode.rst:1118 ../../c-api/unicode.rst:1169
msgid "If *byteorder* is ``NULL``, the codec starts in native order mode."
msgstr ""
-#: ../../c-api/unicode.rst:1102 ../../c-api/unicode.rst:1153
+#: ../../c-api/unicode.rst:1120 ../../c-api/unicode.rst:1171
msgid "Return ``NULL`` if an exception was raised by the codec."
msgstr "如果編解碼器引發例外則回傳 ``NULL``。"
-#: ../../c-api/unicode.rst:1108
+#: ../../c-api/unicode.rst:1126
msgid ""
"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If "
"*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not "
@@ -1393,29 +1417,29 @@ msgid ""
"number of bytes that have been decoded will be stored in *consumed*."
msgstr ""
-#: ../../c-api/unicode.rst:1117
+#: ../../c-api/unicode.rst:1135
msgid ""
"Return a Python byte string using the UTF-32 encoding in native byte order. "
"The string always starts with a BOM mark. Error handling is \"strict\". "
"Return ``NULL`` if an exception was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1123
+#: ../../c-api/unicode.rst:1141
msgid "UTF-16 Codecs"
msgstr "UTF-16 編解碼器"
-#: ../../c-api/unicode.rst:1125
+#: ../../c-api/unicode.rst:1143
msgid "These are the UTF-16 codec APIs:"
msgstr "這些是 UTF-16 編解碼器的 API:"
-#: ../../c-api/unicode.rst:1131
+#: ../../c-api/unicode.rst:1149
msgid ""
"Decode *size* bytes from a UTF-16 encoded buffer string and return the "
"corresponding Unicode object. *errors* (if non-``NULL``) defines the error "
"handling. It defaults to \"strict\"."
msgstr ""
-#: ../../c-api/unicode.rst:1142
+#: ../../c-api/unicode.rst:1160
msgid ""
"If ``*byteorder`` is zero, and the first two bytes of the input data are a "
"byte order mark (BOM), the decoder switches to this byte order and the BOM "
@@ -1424,13 +1448,13 @@ msgid ""
"result in either a ``\\ufeff`` or a ``\\ufffe`` character)."
msgstr ""
-#: ../../c-api/unicode.rst:1148
+#: ../../c-api/unicode.rst:1166
msgid ""
"After completion, ``*byteorder`` is set to the current byte order at the end "
"of input data."
msgstr ""
-#: ../../c-api/unicode.rst:1159
+#: ../../c-api/unicode.rst:1177
msgid ""
"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If "
"*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not "
@@ -1440,28 +1464,28 @@ msgid ""
"*consumed*."
msgstr ""
-#: ../../c-api/unicode.rst:1168
+#: ../../c-api/unicode.rst:1186
msgid ""
"Return a Python byte string using the UTF-16 encoding in native byte order. "
"The string always starts with a BOM mark. Error handling is \"strict\". "
"Return ``NULL`` if an exception was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1174
+#: ../../c-api/unicode.rst:1192
msgid "UTF-7 Codecs"
msgstr "UTF-7 編解碼器"
-#: ../../c-api/unicode.rst:1176
+#: ../../c-api/unicode.rst:1194
msgid "These are the UTF-7 codec APIs:"
msgstr "這些是 UTF-7 編解碼器的 API:"
-#: ../../c-api/unicode.rst:1181
+#: ../../c-api/unicode.rst:1199
msgid ""
"Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string "
"*str*. Return ``NULL`` if an exception was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1188
+#: ../../c-api/unicode.rst:1206
msgid ""
"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If "
"*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will "
@@ -1469,101 +1493,101 @@ msgid ""
"of bytes that have been decoded will be stored in *consumed*."
msgstr ""
-#: ../../c-api/unicode.rst:1195
+#: ../../c-api/unicode.rst:1213
msgid "Unicode-Escape Codecs"
msgstr ""
-#: ../../c-api/unicode.rst:1197
+#: ../../c-api/unicode.rst:1215
msgid "These are the \"Unicode Escape\" codec APIs:"
msgstr ""
-#: ../../c-api/unicode.rst:1203
+#: ../../c-api/unicode.rst:1221
msgid ""
"Create a Unicode object by decoding *size* bytes of the Unicode-Escape "
"encoded string *str*. Return ``NULL`` if an exception was raised by the "
"codec."
msgstr ""
-#: ../../c-api/unicode.rst:1209
+#: ../../c-api/unicode.rst:1227
msgid ""
"Encode a Unicode object using Unicode-Escape and return the result as a "
"bytes object. Error handling is \"strict\". Return ``NULL`` if an "
"exception was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1215
+#: ../../c-api/unicode.rst:1233
msgid "Raw-Unicode-Escape Codecs"
msgstr ""
-#: ../../c-api/unicode.rst:1217
+#: ../../c-api/unicode.rst:1235
msgid "These are the \"Raw Unicode Escape\" codec APIs:"
msgstr ""
-#: ../../c-api/unicode.rst:1223
+#: ../../c-api/unicode.rst:1241
msgid ""
"Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape "
"encoded string *str*. Return ``NULL`` if an exception was raised by the "
"codec."
msgstr ""
-#: ../../c-api/unicode.rst:1229
+#: ../../c-api/unicode.rst:1247
msgid ""
"Encode a Unicode object using Raw-Unicode-Escape and return the result as a "
"bytes object. Error handling is \"strict\". Return ``NULL`` if an "
"exception was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1235
+#: ../../c-api/unicode.rst:1253
msgid "Latin-1 Codecs"
msgstr "Latin-1 編解碼器"
-#: ../../c-api/unicode.rst:1237
+#: ../../c-api/unicode.rst:1255
msgid ""
"These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 "
"Unicode ordinals and only these are accepted by the codecs during encoding."
msgstr ""
-#: ../../c-api/unicode.rst:1243
+#: ../../c-api/unicode.rst:1261
msgid ""
"Create a Unicode object by decoding *size* bytes of the Latin-1 encoded "
"string *str*. Return ``NULL`` if an exception was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1249
+#: ../../c-api/unicode.rst:1267
msgid ""
"Encode a Unicode object using Latin-1 and return the result as Python bytes "
"object. Error handling is \"strict\". Return ``NULL`` if an exception was "
"raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1255
+#: ../../c-api/unicode.rst:1273
msgid "ASCII Codecs"
msgstr "ASCII 編解碼器"
-#: ../../c-api/unicode.rst:1257
+#: ../../c-api/unicode.rst:1275
msgid ""
"These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All "
"other codes generate errors."
msgstr ""
-#: ../../c-api/unicode.rst:1263
+#: ../../c-api/unicode.rst:1281
msgid ""
"Create a Unicode object by decoding *size* bytes of the ASCII encoded string "
"*str*. Return ``NULL`` if an exception was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1269
+#: ../../c-api/unicode.rst:1287
msgid ""
"Encode a Unicode object using ASCII and return the result as Python bytes "
"object. Error handling is \"strict\". Return ``NULL`` if an exception was "
"raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1275
+#: ../../c-api/unicode.rst:1293
msgid "Character Map Codecs"
msgstr ""
-#: ../../c-api/unicode.rst:1277
+#: ../../c-api/unicode.rst:1295
msgid ""
"This codec is special in that it can be used to implement many different "
"codecs (and this is in fact what was done to obtain most of the standard "
@@ -1573,18 +1597,18 @@ msgid ""
"sequences work well."
msgstr ""
-#: ../../c-api/unicode.rst:1283
+#: ../../c-api/unicode.rst:1301
msgid "These are the mapping codec APIs:"
msgstr "這些是對映編解碼器的 API:"
-#: ../../c-api/unicode.rst:1288
+#: ../../c-api/unicode.rst:1306
msgid ""
"Create a Unicode object by decoding *size* bytes of the encoded string *str* "
"using the given *mapping* object. Return ``NULL`` if an exception was "
"raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1292
+#: ../../c-api/unicode.rst:1310
msgid ""
"If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* "
"must map bytes ordinals (integers in the range from 0 to 255) to Unicode "
@@ -1594,14 +1618,14 @@ msgid ""
"treated as undefined mappings and cause an error."
msgstr ""
-#: ../../c-api/unicode.rst:1303
+#: ../../c-api/unicode.rst:1321
msgid ""
"Encode a Unicode object using the given *mapping* object and return the "
"result as a bytes object. Error handling is \"strict\". Return ``NULL`` if "
"an exception was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1307
+#: ../../c-api/unicode.rst:1325
msgid ""
"The *mapping* object must map Unicode ordinal integers to bytes objects, "
"integers in the range from 0 to 255 or ``None``. Unmapped character "
@@ -1609,41 +1633,41 @@ msgid ""
"``None`` are treated as \"undefined mapping\" and cause an error."
msgstr ""
-#: ../../c-api/unicode.rst:1313
+#: ../../c-api/unicode.rst:1331
msgid "The following codec API is special in that maps Unicode to Unicode."
msgstr ""
-#: ../../c-api/unicode.rst:1317
+#: ../../c-api/unicode.rst:1335
msgid ""
"Translate a string by applying a character mapping table to it and return "
"the resulting Unicode object. Return ``NULL`` if an exception was raised by "
"the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1321
+#: ../../c-api/unicode.rst:1339
msgid ""
"The mapping table must map Unicode ordinal integers to Unicode ordinal "
"integers or ``None`` (causing deletion of the character)."
msgstr ""
-#: ../../c-api/unicode.rst:1324
+#: ../../c-api/unicode.rst:1342
msgid ""
"Mapping tables need only provide the :meth:`~object.__getitem__` interface; "
"dictionaries and sequences work well. Unmapped character ordinals (ones "
"which cause a :exc:`LookupError`) are left untouched and are copied as-is."
msgstr ""
-#: ../../c-api/unicode.rst:1328
+#: ../../c-api/unicode.rst:1346
msgid ""
"*errors* has the usual meaning for codecs. It may be ``NULL`` which "
"indicates to use the default error handling."
msgstr ""
-#: ../../c-api/unicode.rst:1333
+#: ../../c-api/unicode.rst:1351
msgid "MBCS codecs for Windows"
msgstr "Windows 的 MBCS 編解碼器"
-#: ../../c-api/unicode.rst:1335
+#: ../../c-api/unicode.rst:1353
msgid ""
"These are the MBCS codec APIs. They are currently only available on Windows "
"and use the Win32 MBCS converters to implement the conversions. Note that "
@@ -1651,13 +1675,13 @@ msgid ""
"is defined by the user settings on the machine running the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1342
+#: ../../c-api/unicode.rst:1360
msgid ""
"Create a Unicode object by decoding *size* bytes of the MBCS encoded string "
"*str*. Return ``NULL`` if an exception was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1349
+#: ../../c-api/unicode.rst:1367
msgid ""
"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If "
"*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not "
@@ -1665,44 +1689,50 @@ msgid ""
"will be stored in *consumed*."
msgstr ""
-#: ../../c-api/unicode.rst:1357
+#: ../../c-api/unicode.rst:1376
+msgid ""
+"Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page "
+"specified by *code_page*."
+msgstr ""
+
+#: ../../c-api/unicode.rst:1382
msgid ""
"Encode a Unicode object using MBCS and return the result as Python bytes "
"object. Error handling is \"strict\". Return ``NULL`` if an exception was "
"raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1364
+#: ../../c-api/unicode.rst:1389
msgid ""
"Encode the Unicode object using the specified code page and return a Python "
-"bytes object. Return ``NULL`` if an exception was raised by the codec. "
-"Use :c:macro:`!CP_ACP` code page to get the MBCS encoder."
+"bytes object. Return ``NULL`` if an exception was raised by the codec. Use :"
+"c:macro:`!CP_ACP` code page to get the MBCS encoder."
msgstr ""
-#: ../../c-api/unicode.rst:1372
+#: ../../c-api/unicode.rst:1397
msgid "Methods & Slots"
msgstr ""
-#: ../../c-api/unicode.rst:1378
+#: ../../c-api/unicode.rst:1403
msgid "Methods and Slot Functions"
msgstr ""
-#: ../../c-api/unicode.rst:1380
+#: ../../c-api/unicode.rst:1405
msgid ""
"The following APIs are capable of handling Unicode objects and strings on "
"input (we refer to them as strings in the descriptions) and return Unicode "
"objects or integers as appropriate."
msgstr ""
-#: ../../c-api/unicode.rst:1384
+#: ../../c-api/unicode.rst:1409
msgid "They all return ``NULL`` or ``-1`` if an exception occurs."
-msgstr ""
+msgstr "如果發生例外,則回傳 ``NULL`` 或 ``-1``。"
-#: ../../c-api/unicode.rst:1389
+#: ../../c-api/unicode.rst:1414
msgid "Concat two strings giving a new Unicode string."
msgstr ""
-#: ../../c-api/unicode.rst:1394
+#: ../../c-api/unicode.rst:1419
msgid ""
"Split a string giving a list of Unicode strings. If *sep* is ``NULL``, "
"splitting will be done at all whitespace substrings. Otherwise, splits "
@@ -1711,27 +1741,73 @@ msgid ""
"list."
msgstr ""
-#: ../../c-api/unicode.rst:1402
+#: ../../c-api/unicode.rst:1424 ../../c-api/unicode.rst:1434
+#: ../../c-api/unicode.rst:1455 ../../c-api/unicode.rst:1468
+msgid "On error, return ``NULL`` with an exception set."
+msgstr "於錯誤發生時回傳 ``NULL`` 並設定例外。"
+
+#: ../../c-api/unicode.rst:1426
+msgid "Equivalent to :py:meth:`str.split`."
+msgstr "等價於 :py:meth:`str.split`。"
+
+#: ../../c-api/unicode.rst:1431
+msgid ""
+"Similar to :c:func:`PyUnicode_Split`, but splitting will be done beginning "
+"at the end of the string."
+msgstr ""
+
+#: ../../c-api/unicode.rst:1436
+msgid "Equivalent to :py:meth:`str.rsplit`."
+msgstr "等價於 :py:meth:`str.rsplit`。"
+
+#: ../../c-api/unicode.rst:1441
msgid ""
"Split a Unicode string at line breaks, returning a list of Unicode strings. "
"CRLF is considered to be one line break. If *keepends* is ``0``, the Line "
"break characters are not included in the resulting strings."
msgstr ""
-#: ../../c-api/unicode.rst:1409
+#: ../../c-api/unicode.rst:1448
+msgid ""
+"Split a Unicode string at the first occurrence of *sep*, and return a 3-"
+"tuple containing the part before the separator, the separator itself, and "
+"the part after the separator. If the separator is not found, return a 3-"
+"tuple containing the string itself, followed by two empty strings."
+msgstr ""
+
+#: ../../c-api/unicode.rst:1453 ../../c-api/unicode.rst:1466
+msgid "*sep* must not be empty."
+msgstr "*sep* 不得為空。"
+
+#: ../../c-api/unicode.rst:1457
+msgid "Equivalent to :py:meth:`str.partition`."
+msgstr "等價於 :py:meth:`str.partition`。"
+
+#: ../../c-api/unicode.rst:1462
+msgid ""
+"Similar to :c:func:`PyUnicode_Partition`, but split a Unicode string at the "
+"last occurrence of *sep*. If the separator is not found, return a 3-tuple "
+"containing two empty strings, followed by the string itself."
+msgstr ""
+
+#: ../../c-api/unicode.rst:1470
+msgid "Equivalent to :py:meth:`str.rpartition`."
+msgstr "等價於 :py:meth:`str.rpartition`。"
+
+#: ../../c-api/unicode.rst:1475
msgid ""
"Join a sequence of strings using the given *separator* and return the "
"resulting Unicode string."
msgstr ""
-#: ../../c-api/unicode.rst:1416
+#: ../../c-api/unicode.rst:1482
msgid ""
"Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail "
"end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` "
"a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred."
msgstr ""
-#: ../../c-api/unicode.rst:1424
+#: ../../c-api/unicode.rst:1490
msgid ""
"Return the first position of *substr* in ``unicode[start:end]`` using the "
"given *direction* (*direction* == ``1`` means to do a forward search, "
@@ -1740,7 +1816,7 @@ msgid ""
"``-2`` indicates that an error occurred and an exception has been set."
msgstr ""
-#: ../../c-api/unicode.rst:1434
+#: ../../c-api/unicode.rst:1500
msgid ""
"Return the first position of the character *ch* in ``unicode[start:end]`` "
"using the given *direction* (*direction* == ``1`` means to do a forward "
@@ -1750,37 +1826,37 @@ msgid ""
"set."
msgstr ""
-#: ../../c-api/unicode.rst:1442
+#: ../../c-api/unicode.rst:1508
msgid ""
"*start* and *end* are now adjusted to behave like ``unicode[start:end]``."
msgstr ""
-#: ../../c-api/unicode.rst:1449
+#: ../../c-api/unicode.rst:1515
msgid ""
"Return the number of non-overlapping occurrences of *substr* in "
"``unicode[start:end]``. Return ``-1`` if an error occurred."
msgstr ""
-#: ../../c-api/unicode.rst:1456
+#: ../../c-api/unicode.rst:1522
msgid ""
"Replace at most *maxcount* occurrences of *substr* in *unicode* with "
"*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` "
"means replace all occurrences."
msgstr ""
-#: ../../c-api/unicode.rst:1463
+#: ../../c-api/unicode.rst:1529
msgid ""
"Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, "
"and greater than, respectively."
msgstr ""
-#: ../../c-api/unicode.rst:1466
+#: ../../c-api/unicode.rst:1532
msgid ""
-"This function returns ``-1`` upon failure, so one should "
-"call :c:func:`PyErr_Occurred` to check for errors."
+"This function returns ``-1`` upon failure, so one should call :c:func:"
+"`PyErr_Occurred` to check for errors."
msgstr ""
-#: ../../c-api/unicode.rst:1472
+#: ../../c-api/unicode.rst:1538
msgid ""
"Compare a Unicode object with a char buffer which is interpreted as being "
"UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false "
@@ -1789,18 +1865,18 @@ msgid ""
"is returned."
msgstr ""
-#: ../../c-api/unicode.rst:1479 ../../c-api/unicode.rst:1500
+#: ../../c-api/unicode.rst:1545 ../../c-api/unicode.rst:1566
msgid "This function does not raise exceptions."
msgstr "此函式不會引發例外。"
-#: ../../c-api/unicode.rst:1486
+#: ../../c-api/unicode.rst:1552
msgid ""
"Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* "
"length using :c:func:`!strlen`. If the Unicode object contains null "
"characters, false (``0``) is returned."
msgstr ""
-#: ../../c-api/unicode.rst:1495
+#: ../../c-api/unicode.rst:1561
msgid ""
"Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, "
"``1`` for less than, equal, and greater than, respectively. It is best to "
@@ -1808,59 +1884,58 @@ msgid ""
"string as ISO-8859-1 if it contains non-ASCII characters."
msgstr ""
-#: ../../c-api/unicode.rst:1505
+#: ../../c-api/unicode.rst:1571
msgid "Rich compare two Unicode strings and return one of the following:"
msgstr ""
-#: ../../c-api/unicode.rst:1507
+#: ../../c-api/unicode.rst:1573
msgid "``NULL`` in case an exception was raised"
msgstr ""
-#: ../../c-api/unicode.rst:1508
+#: ../../c-api/unicode.rst:1574
msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons"
msgstr ""
-#: ../../c-api/unicode.rst:1509
+#: ../../c-api/unicode.rst:1575
msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown"
msgstr ""
-#: ../../c-api/unicode.rst:1511
+#: ../../c-api/unicode.rst:1577
msgid ""
-"Possible values for *op* "
-"are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, "
-"and :c:macro:`Py_LE`."
+"Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:"
+"`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`."
msgstr ""
-#: ../../c-api/unicode.rst:1517
+#: ../../c-api/unicode.rst:1583
msgid ""
"Return a new string object from *format* and *args*; this is analogous to "
"``format % args``."
msgstr ""
-#: ../../c-api/unicode.rst:1523
+#: ../../c-api/unicode.rst:1589
msgid ""
"Check whether *substr* is contained in *unicode* and return true or false "
"accordingly."
msgstr ""
-#: ../../c-api/unicode.rst:1526
+#: ../../c-api/unicode.rst:1592
msgid ""
"*substr* has to coerce to a one element Unicode string. ``-1`` is returned "
"if there was an error."
msgstr ""
-#: ../../c-api/unicode.rst:1532
+#: ../../c-api/unicode.rst:1598
msgid ""
"Intern the argument :c:expr:`*p_unicode` in place. The argument must be the "
"address of a pointer variable pointing to a Python Unicode string object. "
-"If there is an existing interned string that is the same "
-"as :c:expr:`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the "
-"reference to the old string object and creating a new :term:`strong "
-"reference` to the interned string object), otherwise it "
-"leaves :c:expr:`*p_unicode` alone and interns it."
+"If there is an existing interned string that is the same as :c:expr:"
+"`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the reference to "
+"the old string object and creating a new :term:`strong reference` to the "
+"interned string object), otherwise it leaves :c:expr:`*p_unicode` alone and "
+"interns it."
msgstr ""
-#: ../../c-api/unicode.rst:1539
+#: ../../c-api/unicode.rst:1605
msgid ""
"(Clarification: even though there is a lot of talk about references, think "
"of this function as reference-neutral. You must own the object you pass in; "
@@ -1868,48 +1943,47 @@ msgid ""
"the result.)"
msgstr ""
-#: ../../c-api/unicode.rst:1544
+#: ../../c-api/unicode.rst:1610
msgid ""
"This function never raises an exception. On error, it leaves its argument "
"unchanged without interning it."
msgstr ""
-#: ../../c-api/unicode.rst:1547
+#: ../../c-api/unicode.rst:1613
msgid ""
-"Instances of subclasses of :py:class:`str` may not be interned, that "
-"is, :c:expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, "
-"then -- as with any other error -- the argument is left unchanged."
+"Instances of subclasses of :py:class:`str` may not be interned, that is, :c:"
+"expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- "
+"as with any other error -- the argument is left unchanged."
msgstr ""
-#: ../../c-api/unicode.rst:1551
+#: ../../c-api/unicode.rst:1617
msgid ""
"Note that interned strings are not “immortal”. You must keep a reference to "
"the result to benefit from interning."
msgstr ""
-#: ../../c-api/unicode.rst:1557
+#: ../../c-api/unicode.rst:1623
msgid ""
-"A combination of :c:func:`PyUnicode_FromString` "
-"and :c:func:`PyUnicode_InternInPlace`, meant for statically allocated "
-"strings."
+"A combination of :c:func:`PyUnicode_FromString` and :c:func:"
+"`PyUnicode_InternInPlace`, meant for statically allocated strings."
msgstr ""
-#: ../../c-api/unicode.rst:1560
+#: ../../c-api/unicode.rst:1626
msgid ""
"Return a new (\"owned\") reference to either a new Unicode string object "
"that has been interned, or an earlier interned string object with the same "
"value."
msgstr ""
-#: ../../c-api/unicode.rst:1564
+#: ../../c-api/unicode.rst:1630
msgid ""
"Python may keep a reference to the result, or make it :term:`immortal`, "
"preventing it from being garbage-collected promptly. For interning an "
"unbounded number of different strings, such as ones coming from user input, "
-"prefer calling :c:func:`PyUnicode_FromString` "
-"and :c:func:`PyUnicode_InternInPlace` directly."
+"prefer calling :c:func:`PyUnicode_FromString` and :c:func:"
+"`PyUnicode_InternInPlace` directly."
msgstr ""
-#: ../../c-api/unicode.rst:1572
+#: ../../c-api/unicode.rst:1638
msgid "Strings interned this way are made :term:`immortal`."
msgstr ""
diff --git a/copyright.po b/copyright.po
index 63bcc2fbfa..50a39fdee2 100644
--- a/copyright.po
+++ b/copyright.po
@@ -32,9 +32,8 @@ msgid "Python and this documentation is:"
msgstr "Python 和這份說明文件的版權:"
#: ../../copyright.rst:7
-#, fuzzy
msgid "Copyright © 2001-2024 Python Software Foundation. All rights reserved."
-msgstr "Copyright © 2001-2023 Python Software Foundation 保留一切權利。"
+msgstr "Copyright © 2001-2024 Python Software Foundation. All rights reserved."
#: ../../copyright.rst:9
msgid "Copyright © 2000 BeOpen.com. All rights reserved."
diff --git a/deprecations/c-api-pending-removal-in-3.14.po b/deprecations/c-api-pending-removal-in-3.14.po
index ed8747f95e..8541753787 100644
--- a/deprecations/c-api-pending-removal-in-3.14.po
+++ b/deprecations/c-api-pending-removal-in-3.14.po
@@ -24,16 +24,16 @@ msgid ""
"The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules "
"(:pep:`699`; :gh:`101193`)."
msgstr ""
-":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 (:pep:"
-"`699`;:gh:`101193`)。"
+":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 "
+"(:pep:`699`;:gh:`101193`)。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:7
msgid ""
"Creating :c:data:`immutable types ` with mutable "
"bases (:gh:`95388`)."
msgstr ""
-"使用可變基底建立\\ :c:data:`不可變型別 ` (:gh:"
-"`95388`)。"
+"使用可變基底建立\\ :c:data:`不可變型別 ` "
+"(:gh:`95388`)。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:10
msgid ""
@@ -63,8 +63,8 @@ msgstr ":c:func:`!Py_SetPythonHome()`:請改以 :c:member:`PyConfig.home` 設
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:21
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:71
msgid ""
-"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:"
-"`PyConfig` instead."
+"The :c:func:`Py_InitializeFromConfig` API should be used "
+"with :c:type:`PyConfig` instead."
msgstr ""
":c:func:`Py_InitializeFromConfig` API 應該與 :c:type:`PyConfig` 一起使用。"
@@ -121,24 +121,24 @@ msgid ""
":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` "
"instead."
msgstr ""
-":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig."
-"use_environment`。"
+":c:var:`Py_IgnoreEnvironmentFlag`:請改"
+"用 :c:member:`PyConfig.use_environment`。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:46
msgid ""
":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` "
"instead."
msgstr ""
-":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig."
-"write_bytecode`。"
+":c:var:`Py_DontWriteBytecodeFlag`:請改"
+"用 :c:member:`PyConfig.write_bytecode`。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:48
msgid ""
-":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig."
-"user_site_directory` instead."
+":c:var:`Py_NoUserSiteDirectory`: "
+"Use :c:member:`PyConfig.user_site_directory` instead."
msgstr ""
-":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig."
-"user_site_directory`。"
+":c:var:`Py_NoUserSiteDirectory`:請改"
+"用 :c:member:`PyConfig.user_site_directory`。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:50
msgid ""
@@ -161,48 +161,48 @@ msgstr ":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated`。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:57
msgid ""
-":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig."
-"legacy_windows_fs_encoding` instead."
+":c:var:`Py_LegacyWindowsFSEncodingFlag`: "
+"Use :c:member:`PyPreConfig.legacy_windows_fs_encoding` instead."
msgstr ""
-":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig."
-"legacy_windows_fs_encoding`。"
+":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改"
+"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding`。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:59
msgid ""
-":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig."
-"legacy_windows_stdio` instead."
+":c:var:`Py_LegacyWindowsStdioFlag`: "
+"Use :c:member:`PyConfig.legacy_windows_stdio` instead."
msgstr ""
-":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig."
-"legacy_windows_stdio`。"
+":c:var:`Py_LegacyWindowsStdioFlag`:請改"
+"用 :c:member:`PyConfig.legacy_windows_stdio`。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:61
msgid ""
-":c:var:`!Py_FileSystemDefaultEncoding`: Use :c:member:`PyConfig."
-"filesystem_encoding` instead."
+":c:var:`!Py_FileSystemDefaultEncoding`: "
+"Use :c:member:`PyConfig.filesystem_encoding` instead."
msgstr ""
-":c:var:`!Py_FileSystemDefaultEncoding`:請改用 :c:member:`PyConfig."
-"filesystem_encoding`。"
+":c:var:`!Py_FileSystemDefaultEncoding`:請改"
+"用 :c:member:`PyConfig.filesystem_encoding`。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:63
msgid ""
-":c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig."
-"filesystem_encoding` instead."
+":c:var:`!Py_HasFileSystemDefaultEncoding`: "
+"Use :c:member:`PyConfig.filesystem_encoding` instead."
msgstr ""
-":c:var:`!Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig."
-"filesystem_encoding`。"
+":c:var:`!Py_HasFileSystemDefaultEncoding`:請改"
+"用 :c:member:`PyConfig.filesystem_encoding`。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:65
msgid ""
-":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig."
-"filesystem_errors` instead."
+":c:var:`!Py_FileSystemDefaultEncodeErrors`: "
+"Use :c:member:`PyConfig.filesystem_errors` instead."
msgstr ""
-":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig."
-"filesystem_errors`。"
+":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改"
+"用 :c:member:`PyConfig.filesystem_errors`。"
#: ../../deprecations/c-api-pending-removal-in-3.14.rst:67
msgid ""
-":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. (see :"
-"c:func:`Py_PreInitialize`)"
+":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. "
+"(see :c:func:`Py_PreInitialize`)"
msgstr ""
-":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請見 :c:"
-"func:`Py_PreInitialize`)"
+":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請"
+"見 :c:func:`Py_PreInitialize`)"
diff --git a/deprecations/c-api-pending-removal-in-3.15.po b/deprecations/c-api-pending-removal-in-3.15.po
index f828c57849..4faa829fa8 100644
--- a/deprecations/c-api-pending-removal-in-3.15.po
+++ b/deprecations/c-api-pending-removal-in-3.15.po
@@ -25,27 +25,27 @@ msgstr "``libmpdecimal`` 的打包副本 (bundled copy)。"
#: ../../deprecations/c-api-pending-removal-in-3.15.rst:5
msgid ""
-"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:"
-"`PyImport_ImportModule` instead."
+"The :c:func:`PyImport_ImportModuleNoBlock`: "
+"Use :c:func:`PyImport_ImportModule` instead."
msgstr ""
-":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:"
-"`PyImport_ImportModule`。"
+":c:func:`PyImport_ImportModuleNoBlock`:請改"
+"用 :c:func:`PyImport_ImportModule`。"
#: ../../deprecations/c-api-pending-removal-in-3.15.rst:7
msgid ""
-":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:"
-"func:`PyWeakref_GetRef` instead."
+":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: "
+"Use :c:func:`PyWeakref_GetRef` instead."
msgstr ""
-":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改用 :c:"
-"func:`PyWeakref_GetRef`。"
+":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改"
+"用 :c:func:`PyWeakref_GetRef`。"
#: ../../deprecations/c-api-pending-removal-in-3.15.rst:9
msgid ""
-":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:"
-"type:`wchar_t` instead."
+":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: "
+"Use :c:type:`wchar_t` instead."
msgstr ""
-":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改用 :c:type:"
-"`wchar_t`。"
+":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改"
+"用 :c:type:`wchar_t`。"
#: ../../deprecations/c-api-pending-removal-in-3.15.rst:11
msgid "Python initialization functions:"
@@ -56,16 +56,16 @@ msgid ""
":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!"
"warnings.filters` instead."
msgstr ""
-":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :"
-"data:`!warnings.filters`。"
+":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` "
+"和 :data:`!warnings.filters`。"
#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15
msgid ""
-":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys."
-"exec_prefix` instead."
+":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` "
+"and :data:`sys.exec_prefix` instead."
msgstr ""
-":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.base_exec_prefix` 與 :data:"
-"`sys.exec_prefix`。"
+":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.base_exec_prefix` "
+"與 :data:`sys.exec_prefix`。"
#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17
msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead."
@@ -76,8 +76,8 @@ msgid ""
":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` "
"instead."
msgstr ""
-":c:func:`Py_GetPrefix`:請改用 :data:`sys.base_prefix` 與 :data:`sys."
-"prefix`。"
+":c:func:`Py_GetPrefix`:請改用 :data:`sys.base_prefix` "
+"與 :data:`sys.prefix`。"
#: ../../deprecations/c-api-pending-removal-in-3.15.rst:21
msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead."
@@ -89,8 +89,8 @@ msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。"
#: ../../deprecations/c-api-pending-removal-in-3.15.rst:25
msgid ""
-":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:"
-"`PYTHONHOME` environment variable instead."
+":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or "
+"the :envvar:`PYTHONHOME` environment variable instead."
msgstr ""
-":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:"
-"`PYTHONHOME` 環境變數。"
+":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` "
+"或 :envvar:`PYTHONHOME` 環境變數。"
diff --git a/deprecations/c-api-pending-removal-in-future.po b/deprecations/c-api-pending-removal-in-future.po
index 49bec35846..a9930288d2 100644
--- a/deprecations/c-api-pending-removal-in-future.po
+++ b/deprecations/c-api-pending-removal-in-future.po
@@ -38,8 +38,8 @@ msgid ""
":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` "
"instead."
msgstr ""
-":c:func:`PyErr_NormalizeException`:請改用 :c:func:"
-"`PyErr_GetRaisedException`。"
+":c:func:`PyErr_NormalizeException`:請改"
+"用 :c:func:`PyErr_GetRaisedException`。"
#: ../../deprecations/c-api-pending-removal-in-future.rst:13
msgid ""
@@ -59,11 +59,11 @@ msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。"
#: ../../deprecations/c-api-pending-removal-in-future.rst:19
msgid ""
-":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:"
-"`PySlice_AdjustIndices` instead."
+":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` "
+"and :c:func:`PySlice_AdjustIndices` instead."
msgstr ""
-":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:"
-"`PySlice_AdjustIndices`。"
+":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` "
+"和 :c:func:`PySlice_AdjustIndices`。"
#: ../../deprecations/c-api-pending-removal-in-future.rst:21
msgid ""
@@ -109,8 +109,8 @@ msgid ""
":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` "
"instead."
msgstr ""
-":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:"
-"`PyObject_Hash`。"
+":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼"
+"叫 :c:func:`PyObject_Hash`。"
#: ../../deprecations/c-api-pending-removal-in-future.rst:37
msgid ":c:member:`!PyDictObject.ma_version_tag` member."
diff --git a/deprecations/index.po b/deprecations/index.po
index b6c4ff73e5..05c5babe57 100644
--- a/deprecations/index.po
+++ b/deprecations/index.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-11-10 17:21+0000\n"
+"POT-Creation-Date: 2025-04-30 00:15+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -321,10 +321,19 @@ msgstr ""
"cgi` 旗標已被棄用。"
#: ../../deprecations/pending-removal-in-3.15.rst:32
+#: ../../deprecations/pending-removal-in-future.rst:56
+msgid ":mod:`importlib`:"
+msgstr ":mod:`importlib`:"
+
+#: ../../deprecations/pending-removal-in-3.15.rst:34
+msgid "``load_module()`` method: use ``exec_module()`` instead."
+msgstr "``load_module()`` method:請改用 ``exec_module()``。"
+
+#: ../../deprecations/pending-removal-in-3.15.rst:36
msgid ":class:`locale`:"
msgstr ":class:`locale`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:34
+#: ../../deprecations/pending-removal-in-3.15.rst:38
msgid ""
"The :func:`~locale.getdefaultlocale` function has been deprecated since "
"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:"
@@ -337,11 +346,11 @@ msgstr ""
"`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale."
"getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)"
-#: ../../deprecations/pending-removal-in-3.15.rst:42
+#: ../../deprecations/pending-removal-in-3.15.rst:46
msgid ":mod:`pathlib`:"
msgstr ":mod:`pathlib`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:44
+#: ../../deprecations/pending-removal-in-3.15.rst:48
msgid ""
":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :"
"func:`os.path.isreserved` to detect reserved paths on Windows."
@@ -349,11 +358,11 @@ msgstr ""
":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path."
"isreserved` 來偵測 Windows 上的保留路徑。"
-#: ../../deprecations/pending-removal-in-3.15.rst:48
+#: ../../deprecations/pending-removal-in-3.15.rst:52
msgid ":mod:`platform`:"
msgstr ":mod:`platform`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:50
+#: ../../deprecations/pending-removal-in-3.15.rst:54
msgid ""
":func:`~platform.java_ver` has been deprecated since Python 3.13. This "
"function is only useful for Jython support, has a confusing API, and is "
@@ -362,11 +371,23 @@ msgstr ""
"自 Python 3.13 起,:func:`~platform.java_ver` 已被棄用。此函式僅對 Jython 支"
"援有用,具有令人困惑的 API,基本上未經測試。"
-#: ../../deprecations/pending-removal-in-3.15.rst:54
+#: ../../deprecations/pending-removal-in-3.15.rst:58
+msgid ":mod:`sysconfig`:"
+msgstr ":mod:`sysconfig`:"
+
+#: ../../deprecations/pending-removal-in-3.15.rst:60
+msgid ""
+"The *check_home* argument of :func:`sysconfig.is_python_build` has been "
+"deprecated since Python 3.12."
+msgstr ""
+":func:`sysconfig.is_python_build` 的 *check_home* 引數自 Python 3.12 起已被棄"
+"用。"
+
+#: ../../deprecations/pending-removal-in-3.15.rst:63
msgid ":mod:`threading`:"
msgstr ":mod:`threading`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:56
+#: ../../deprecations/pending-removal-in-3.15.rst:65
msgid ""
":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any "
"arguments has been deprecated since Python 3.14, as the Python version does "
@@ -377,11 +398,11 @@ msgstr ""
"起,傳遞任何引數的用法已被棄用,因為 Python 版本不允許任何引數,但 C 版本允許"
"任意數量的位置或關鍵字引數,並忽略每個引數。"
-#: ../../deprecations/pending-removal-in-3.15.rst:62
+#: ../../deprecations/pending-removal-in-3.15.rst:71
msgid ":mod:`types`:"
msgstr ":mod:`types`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:64
+#: ../../deprecations/pending-removal-in-3.15.rst:73
msgid ""
":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was "
"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, "
@@ -393,11 +414,11 @@ msgstr ""
"exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:"
"`101866` 貢獻。)"
-#: ../../deprecations/pending-removal-in-3.15.rst:71
+#: ../../deprecations/pending-removal-in-3.15.rst:80
msgid ":mod:`typing`:"
msgstr ":mod:`typing`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:73
+#: ../../deprecations/pending-removal-in-3.15.rst:82
msgid ""
"The undocumented keyword argument syntax for creating :class:`~typing."
"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) "
@@ -408,7 +429,7 @@ msgstr ""
"(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改"
"用基於類別的語法或函式語法 (functional syntax)。"
-#: ../../deprecations/pending-removal-in-3.15.rst:79
+#: ../../deprecations/pending-removal-in-3.15.rst:88
msgid ""
"The :func:`typing.no_type_check_decorator` decorator function has been "
"deprecated since Python 3.13. After eight years in the :mod:`typing` module, "
@@ -418,11 +439,11 @@ msgstr ""
"用。在 :mod:`typing` 模組中使用了八年之後,它尚未得到任何主要型別檢查器的支"
"援。"
-#: ../../deprecations/pending-removal-in-3.15.rst:84
+#: ../../deprecations/pending-removal-in-3.15.rst:93
msgid ":mod:`wave`:"
msgstr ":mod:`wave`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:86
+#: ../../deprecations/pending-removal-in-3.15.rst:95
msgid ""
"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave."
"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:"
@@ -472,7 +493,7 @@ msgstr ""
"gh:`122875` 貢獻。)"
#: ../../deprecations/pending-removal-in-3.16.rst:26
-#: ../../deprecations/pending-removal-in-future.rst:12
+#: ../../deprecations/pending-removal-in-future.rst:10
msgid ":mod:`builtins`:"
msgstr ":mod:`builtins`:"
@@ -556,15 +577,11 @@ msgid ""
"groups are deprecated."
msgstr ":mod:`argparse`:已棄用巢狀引數群組和巢狀互斥群組。"
-#: ../../deprecations/pending-removal-in-future.rst:10
-msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)"
-msgstr ":mod:`array` 的 ``'u'`` 格式碼 (:gh:`57281`)"
-
-#: ../../deprecations/pending-removal-in-future.rst:14
+#: ../../deprecations/pending-removal-in-future.rst:12
msgid "``bool(NotImplemented)``."
msgstr "``bool(NotImplemented)``。"
-#: ../../deprecations/pending-removal-in-future.rst:15
+#: ../../deprecations/pending-removal-in-future.rst:13
msgid ""
"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature "
"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single "
@@ -573,7 +590,7 @@ msgstr ""
"產生器:``throw(type, exc, tb)`` 和 ``athrow(type, exc, tb)`` 簽名已被棄用:"
"請改用 ``throw(exc)`` 和 ``athrow(exc)``,為單引數簽名。"
-#: ../../deprecations/pending-removal-in-future.rst:18
+#: ../../deprecations/pending-removal-in-future.rst:16
msgid ""
"Currently Python accepts numeric literals immediately followed by keywords, "
"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and "
@@ -591,7 +608,7 @@ msgstr ""
"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版"
"本中,它將被更改為語法錯誤。(:gh:`87999`)"
-#: ../../deprecations/pending-removal-in-future.rst:26
+#: ../../deprecations/pending-removal-in-future.rst:24
msgid ""
"Support for ``__index__()`` and ``__int__()`` method returning non-int type: "
"these methods will be required to return an instance of a strict subclass "
@@ -600,7 +617,7 @@ msgstr ""
"``__index__()`` 和 ``__int__()`` 方法回傳非 int 型別的支援:這些方法將需要回"
"傳 :class:`int` 的嚴格子類別實例。"
-#: ../../deprecations/pending-removal-in-future.rst:29
+#: ../../deprecations/pending-removal-in-future.rst:27
msgid ""
"Support for ``__float__()`` method returning a strict subclass of :class:"
"`float`: these methods will be required to return an instance of :class:"
@@ -609,7 +626,7 @@ msgstr ""
"回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回"
"傳 :class:`float` 的實例。"
-#: ../../deprecations/pending-removal-in-future.rst:32
+#: ../../deprecations/pending-removal-in-future.rst:30
msgid ""
"Support for ``__complex__()`` method returning a strict subclass of :class:"
"`complex`: these methods will be required to return an instance of :class:"
@@ -618,11 +635,11 @@ msgstr ""
"回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要"
"回傳 :class:`complex` 的實例。"
-#: ../../deprecations/pending-removal-in-future.rst:35
+#: ../../deprecations/pending-removal-in-future.rst:33
msgid "Delegation of ``int()`` to ``__trunc__()`` method."
msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。"
-#: ../../deprecations/pending-removal-in-future.rst:36
+#: ../../deprecations/pending-removal-in-future.rst:34
msgid ""
"Passing a complex number as the *real* or *imag* argument in the :func:"
"`complex` constructor is now deprecated; it should only be passed as a "
@@ -632,7 +649,7 @@ msgstr ""
"在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;"
"它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:41
+#: ../../deprecations/pending-removal-in-future.rst:39
msgid ""
":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants "
"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar."
@@ -642,18 +659,18 @@ msgstr ""
"被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince "
"Roshan 於 :gh:`103636` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:46
+#: ../../deprecations/pending-removal-in-future.rst:44
msgid ""
":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method "
"instead."
msgstr ""
":attr:`codeobject.co_lnotab`:請改用 :meth:`codeobject.co_lines` 方法。"
-#: ../../deprecations/pending-removal-in-future.rst:49
+#: ../../deprecations/pending-removal-in-future.rst:47
msgid ":mod:`datetime`:"
msgstr ":mod:`datetime`:"
-#: ../../deprecations/pending-removal-in-future.rst:51
+#: ../../deprecations/pending-removal-in-future.rst:49
msgid ""
":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime."
"UTC)``."
@@ -661,7 +678,7 @@ msgstr ""
":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime."
"now(tz=datetime.UTC)``。"
-#: ../../deprecations/pending-removal-in-future.rst:53
+#: ../../deprecations/pending-removal-in-future.rst:51
msgid ""
":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime."
"fromtimestamp(timestamp, tz=datetime.UTC)``."
@@ -669,19 +686,11 @@ msgstr ""
":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime."
"fromtimestamp(timestamp, tz=datetime.UTC)``。"
-#: ../../deprecations/pending-removal-in-future.rst:56
+#: ../../deprecations/pending-removal-in-future.rst:54
msgid ":mod:`gettext`: Plural value must be an integer."
msgstr ":mod:`gettext`:複數值必須是整數。"
#: ../../deprecations/pending-removal-in-future.rst:58
-msgid ":mod:`importlib`:"
-msgstr ":mod:`importlib`:"
-
-#: ../../deprecations/pending-removal-in-future.rst:60
-msgid "``load_module()`` method: use ``exec_module()`` instead."
-msgstr "``load_module()`` method:請改用 ``exec_module()``。"
-
-#: ../../deprecations/pending-removal-in-future.rst:61
msgid ""
":func:`~importlib.util.cache_from_source` *debug_override* parameter is "
"deprecated: use the *optimization* parameter instead."
@@ -689,19 +698,19 @@ msgstr ""
":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改"
"用 *optimization* 參數。"
-#: ../../deprecations/pending-removal-in-future.rst:64
+#: ../../deprecations/pending-removal-in-future.rst:61
msgid ":mod:`importlib.metadata`:"
msgstr ":mod:`importlib.metadata`:"
-#: ../../deprecations/pending-removal-in-future.rst:66
+#: ../../deprecations/pending-removal-in-future.rst:63
msgid "``EntryPoints`` tuple interface."
msgstr "``EntryPoints`` 元組介面。"
-#: ../../deprecations/pending-removal-in-future.rst:67
+#: ../../deprecations/pending-removal-in-future.rst:64
msgid "Implicit ``None`` on return values."
msgstr "回傳值上的隱式 ``None``。"
-#: ../../deprecations/pending-removal-in-future.rst:69
+#: ../../deprecations/pending-removal-in-future.rst:66
msgid ""
":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, "
"use :meth:`~logging.warning` instead."
@@ -709,19 +718,19 @@ msgstr ""
":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:"
"`~logging.warning`。"
-#: ../../deprecations/pending-removal-in-future.rst:72
+#: ../../deprecations/pending-removal-in-future.rst:69
msgid ""
":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use "
"BytesIO and binary mode instead."
msgstr ""
":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。"
-#: ../../deprecations/pending-removal-in-future.rst:75
+#: ../../deprecations/pending-removal-in-future.rst:72
msgid ""
":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process."
msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。"
-#: ../../deprecations/pending-removal-in-future.rst:77
+#: ../../deprecations/pending-removal-in-future.rst:74
msgid ""
":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is "
"deprecated, use an exception instance."
@@ -729,7 +738,7 @@ msgstr ""
":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外"
"實例。"
-#: ../../deprecations/pending-removal-in-future.rst:80
+#: ../../deprecations/pending-removal-in-future.rst:77
msgid ""
":mod:`re`: More strict rules are now applied for numerical group references "
"and group names in regular expressions. Only sequence of ASCII digits is "
@@ -741,12 +750,12 @@ msgstr ""
"有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能"
"包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:87
+#: ../../deprecations/pending-removal-in-future.rst:84
msgid ""
":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules."
msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。"
-#: ../../deprecations/pending-removal-in-future.rst:89
+#: ../../deprecations/pending-removal-in-future.rst:86
msgid ""
":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in "
"Python 3.12; use the *onexc* parameter instead."
@@ -754,15 +763,15 @@ msgstr ""
":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被"
"棄用;請改用 *onexc* 參數。"
-#: ../../deprecations/pending-removal-in-future.rst:92
+#: ../../deprecations/pending-removal-in-future.rst:89
msgid ":mod:`ssl` options and protocols:"
msgstr ":mod:`ssl` 選項和協定:"
-#: ../../deprecations/pending-removal-in-future.rst:94
+#: ../../deprecations/pending-removal-in-future.rst:91
msgid ":class:`ssl.SSLContext` without protocol argument is deprecated."
msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。"
-#: ../../deprecations/pending-removal-in-future.rst:95
+#: ../../deprecations/pending-removal-in-future.rst:92
msgid ""
":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:"
"`!selected_npn_protocol` are deprecated: use ALPN instead."
@@ -770,58 +779,51 @@ msgstr ""
":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:"
"`!selected_npn_protocol` 已被棄用:請改用 ALPN。"
-#: ../../deprecations/pending-removal-in-future.rst:98
+#: ../../deprecations/pending-removal-in-future.rst:95
msgid "``ssl.OP_NO_SSL*`` options"
msgstr "``ssl.OP_NO_SSL*`` 選項"
-#: ../../deprecations/pending-removal-in-future.rst:99
+#: ../../deprecations/pending-removal-in-future.rst:96
msgid "``ssl.OP_NO_TLS*`` options"
msgstr "``ssl.OP_NO_TLS*`` 選項"
-#: ../../deprecations/pending-removal-in-future.rst:100
+#: ../../deprecations/pending-removal-in-future.rst:97
msgid "``ssl.PROTOCOL_SSLv3``"
msgstr "``ssl.PROTOCOL_SSLv3``"
-#: ../../deprecations/pending-removal-in-future.rst:101
+#: ../../deprecations/pending-removal-in-future.rst:98
msgid "``ssl.PROTOCOL_TLS``"
msgstr "``ssl.PROTOCOL_TLS``"
-#: ../../deprecations/pending-removal-in-future.rst:102
+#: ../../deprecations/pending-removal-in-future.rst:99
msgid "``ssl.PROTOCOL_TLSv1``"
msgstr "``ssl.PROTOCOL_TLSv1``"
-#: ../../deprecations/pending-removal-in-future.rst:103
+#: ../../deprecations/pending-removal-in-future.rst:100
msgid "``ssl.PROTOCOL_TLSv1_1``"
msgstr "``ssl.PROTOCOL_TLSv1_1``"
-#: ../../deprecations/pending-removal-in-future.rst:104
+#: ../../deprecations/pending-removal-in-future.rst:101
msgid "``ssl.PROTOCOL_TLSv1_2``"
msgstr "``ssl.PROTOCOL_TLSv1_2``"
-#: ../../deprecations/pending-removal-in-future.rst:105
+#: ../../deprecations/pending-removal-in-future.rst:102
msgid "``ssl.TLSVersion.SSLv3``"
msgstr "``ssl.TLSVersion.SSLv3``"
-#: ../../deprecations/pending-removal-in-future.rst:106
+#: ../../deprecations/pending-removal-in-future.rst:103
msgid "``ssl.TLSVersion.TLSv1``"
msgstr "``ssl.TLSVersion.TLSv1``"
-#: ../../deprecations/pending-removal-in-future.rst:107
+#: ../../deprecations/pending-removal-in-future.rst:104
msgid "``ssl.TLSVersion.TLSv1_1``"
msgstr "``ssl.TLSVersion.TLSv1_1``"
-#: ../../deprecations/pending-removal-in-future.rst:109
-msgid ""
-":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and "
-"ignored."
-msgstr ""
-":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。"
-
-#: ../../deprecations/pending-removal-in-future.rst:112
+#: ../../deprecations/pending-removal-in-future.rst:106
msgid ":mod:`threading` methods:"
msgstr ":mod:`threading` 方法:"
-#: ../../deprecations/pending-removal-in-future.rst:114
+#: ../../deprecations/pending-removal-in-future.rst:108
msgid ""
":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition."
"notify_all`."
@@ -829,11 +831,11 @@ msgstr ""
":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition."
"notify_all`。"
-#: ../../deprecations/pending-removal-in-future.rst:115
+#: ../../deprecations/pending-removal-in-future.rst:109
msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`."
msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。"
-#: ../../deprecations/pending-removal-in-future.rst:116
+#: ../../deprecations/pending-removal-in-future.rst:110
msgid ""
":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :"
"attr:`threading.Thread.daemon` attribute."
@@ -841,7 +843,7 @@ msgstr ""
":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請"
"用 :attr:`threading.Thread.daemon` 屬性。"
-#: ../../deprecations/pending-removal-in-future.rst:118
+#: ../../deprecations/pending-removal-in-future.rst:112
msgid ""
":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :"
"attr:`threading.Thread.name` attribute."
@@ -849,20 +851,20 @@ msgstr ""
":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :"
"attr:`threading.Thread.name` 屬性。"
-#: ../../deprecations/pending-removal-in-future.rst:120
+#: ../../deprecations/pending-removal-in-future.rst:114
msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`."
msgstr ""
":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。"
-#: ../../deprecations/pending-removal-in-future.rst:121
+#: ../../deprecations/pending-removal-in-future.rst:115
msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`."
msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。"
-#: ../../deprecations/pending-removal-in-future.rst:123
+#: ../../deprecations/pending-removal-in-future.rst:117
msgid ":class:`typing.Text` (:gh:`92332`)."
msgstr ":class:`typing.Text` (:gh:`92332`)。"
-#: ../../deprecations/pending-removal-in-future.rst:125
+#: ../../deprecations/pending-removal-in-future.rst:119
msgid ""
":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a "
"value that is not ``None`` from a test case."
@@ -870,58 +872,58 @@ msgstr ""
":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已"
"被棄用。"
-#: ../../deprecations/pending-removal-in-future.rst:128
+#: ../../deprecations/pending-removal-in-future.rst:122
msgid ""
":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` "
"instead"
msgstr ""
":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。"
-#: ../../deprecations/pending-removal-in-future.rst:130
+#: ../../deprecations/pending-removal-in-future.rst:124
msgid "``splitattr()``"
msgstr "``splitattr()``"
-#: ../../deprecations/pending-removal-in-future.rst:131
+#: ../../deprecations/pending-removal-in-future.rst:125
msgid "``splithost()``"
msgstr "``splithost()``"
-#: ../../deprecations/pending-removal-in-future.rst:132
+#: ../../deprecations/pending-removal-in-future.rst:126
msgid "``splitnport()``"
msgstr "``splitnport()``"
-#: ../../deprecations/pending-removal-in-future.rst:133
+#: ../../deprecations/pending-removal-in-future.rst:127
msgid "``splitpasswd()``"
msgstr "``splitpasswd()``"
-#: ../../deprecations/pending-removal-in-future.rst:134
+#: ../../deprecations/pending-removal-in-future.rst:128
msgid "``splitport()``"
msgstr "``splitport()``"
-#: ../../deprecations/pending-removal-in-future.rst:135
+#: ../../deprecations/pending-removal-in-future.rst:129
msgid "``splitquery()``"
msgstr "``splitquery()``"
-#: ../../deprecations/pending-removal-in-future.rst:136
+#: ../../deprecations/pending-removal-in-future.rst:130
msgid "``splittag()``"
msgstr "``splittag()``"
-#: ../../deprecations/pending-removal-in-future.rst:137
+#: ../../deprecations/pending-removal-in-future.rst:131
msgid "``splittype()``"
msgstr "``splittype()``"
-#: ../../deprecations/pending-removal-in-future.rst:138
+#: ../../deprecations/pending-removal-in-future.rst:132
msgid "``splituser()``"
msgstr "``splituser()``"
-#: ../../deprecations/pending-removal-in-future.rst:139
+#: ../../deprecations/pending-removal-in-future.rst:133
msgid "``splitvalue()``"
msgstr "``splitvalue()``"
-#: ../../deprecations/pending-removal-in-future.rst:140
+#: ../../deprecations/pending-removal-in-future.rst:134
msgid "``to_bytes()``"
msgstr "``to_bytes()``"
-#: ../../deprecations/pending-removal-in-future.rst:142
+#: ../../deprecations/pending-removal-in-future.rst:136
msgid ""
":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:"
"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. "
@@ -931,13 +933,13 @@ msgstr ""
"class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:"
"`~urllib.request.urlopen` 函式和方法。"
-#: ../../deprecations/pending-removal-in-future.rst:146
+#: ../../deprecations/pending-removal-in-future.rst:140
msgid ""
":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial "
"writes."
msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。"
-#: ../../deprecations/pending-removal-in-future.rst:149
+#: ../../deprecations/pending-removal-in-future.rst:143
msgid ""
":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml."
"etree.ElementTree.Element` is deprecated. In a future release it will always "
@@ -948,7 +950,7 @@ msgstr ""
"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 "
"``len(elem)`` 或 ``elem is not None`` 測試。"
-#: ../../deprecations/pending-removal-in-future.rst:154
+#: ../../deprecations/pending-removal-in-future.rst:148
msgid ""
":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:"
"`~zipimport.zipimporter.exec_module` instead."
@@ -1354,3 +1356,6 @@ msgstr ""
#: ../../deprecations/c-api-pending-removal-in-future.rst:50
msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7."
msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。"
+
+#~ msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)"
+#~ msgstr ":mod:`array` 的 ``'u'`` 格式碼 (:gh:`57281`)"
diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po
index f6e86c446f..bd8e164bd3 100644
--- a/deprecations/pending-removal-in-3.14.po
+++ b/deprecations/pending-removal-in-3.14.po
@@ -60,8 +60,8 @@ msgstr ":class:`!ast.Ellipsis`"
#: ../../deprecations/pending-removal-in-3.14.rst:19
msgid ""
-"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:"
-"`90953`.)"
+"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka "
+"in :gh:`90953`.)"
msgstr ""
"請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)"
@@ -71,27 +71,26 @@ msgstr ":mod:`asyncio`:"
#: ../../deprecations/pending-removal-in-3.14.rst:24
msgid ""
-"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:"
-"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :"
-"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in "
+"The child watcher "
+"classes :class:`~asyncio.MultiLoopChildWatcher`, :class:`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` "
+"and :class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in "
"Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)"
msgstr ""
-"已棄用並將在 Python 3.14 中移除的 child watcher 類別::class:`~asyncio."
-"MultiLoopChildWatcher`、:class:`~asyncio.FastChildWatcher`、:class:`~asyncio."
-"AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar "
-"Aditya 於 :gh:`94597` 貢獻。)"
+"已棄用並將在 Python 3.14 中移除的 child watcher 類"
+"別::class:`~asyncio.MultiLoopChildWatcher`、:class:`~asyncio.FastChildWatcher`、:class:`~asyncio.AbstractChildWatcher` "
+"和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar Aditya 於 :gh:`94597` 貢"
+"獻。)"
#: ../../deprecations/pending-removal-in-3.14.rst:30
msgid ""
-":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:"
-"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio."
-"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be "
-"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)"
+":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` "
+"and :meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated "
+"and will be removed in Python 3.14. (Contributed by Kumar Aditya "
+"in :gh:`94597`.)"
msgstr ""
-":func:`asyncio.set_child_watcher`、:func:`asyncio.get_child_watcher`、:meth:"
-"`asyncio.AbstractEventLoopPolicy.set_child_watcher` 和 :meth:`asyncio."
-"AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移"
-"除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)"
+":func:`asyncio.set_child_watcher`、:func:`asyncio.get_child_watcher`、:meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` "
+"和 :meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 "
+"Python 3.14 中移除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)"
#: ../../deprecations/pending-removal-in-3.14.rst:36
msgid ""
@@ -108,18 +107,21 @@ msgstr ""
msgid ""
":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. "
"Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in "
-"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections."
-"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)"
+"typing, prefer a union, like ``bytes | bytearray``, "
+"or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain "
+"in :gh:`91896`.)"
msgstr ""
-":mod:`collections.abc`:已棄用 :class:`~collections.abc.ByteString`。請改用 :"
-"class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用時,請"
-"改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 "
-"Shantanu Jain 於 :gh:`91896` 貢獻。)"
+":mod:`collections.abc`:已棄用 :class:`~collections.abc.ByteString`。請改"
+"用 :class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用"
+"時,請改用聯集,如 ``bytes | bytearray``,"
+"或 :class:`collections.abc.Buffer`。(由 Shantanu Jain 於 :gh:`91896` 貢"
+"獻。)"
#: ../../deprecations/pending-removal-in-3.14.rst:47
msgid ""
-":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils."
-"localtime`. (Contributed by Alan Williams in :gh:`72346`.)"
+":mod:`email`: Deprecated the *isdst* parameter "
+"in :func:`email.utils.localtime`. (Contributed by Alan Williams "
+"in :gh:`72346`.)"
msgstr ""
":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 "
"Alan Williams 於 :gh:`72346` 貢獻。)"
@@ -173,24 +175,25 @@ msgid ""
"on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is "
"currently the default (:gh:`84559`). Adding a runtime warning about this was "
"deemed too disruptive as the majority of code is not expected to care. Use "
-"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing."
-"set_start_method` APIs to explicitly specify when your code *requires* "
-"``'fork'``. See :ref:`multiprocessing-start-methods`."
+"the :func:`~multiprocessing.get_context` "
+"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when "
+"your code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`."
msgstr ""
":mod:`multiprocessing`:預設的啟動方法將在 Linux、BSD 和其他非 macOS POSIX 平"
"台上更改為更安全的 方法,目前 ``'fork'`` 是預設值 (:gh:`84559`)。對此增加一"
-"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使用 :func:"
-"`~multiprocessing.get_context` 或 :func:`~multiprocessing.set_start_method` "
-"API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:"
-"`multiprocessing-start-methods`。"
+"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使"
+"用 :func:`~multiprocessing.get_context` "
+"或 :func:`~multiprocessing.set_start_method` API 來明確指定你的程式碼何時\\ *"
+"需要* ``'fork'``。請參閱 :ref:`multiprocessing-start-methods`。"
#: ../../deprecations/pending-removal-in-3.14.rst:77
msgid ""
-":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib."
-"PurePath.relative_to`: passing additional arguments is deprecated."
+":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` "
+"and :meth:`~pathlib.PurePath.relative_to`: passing additional arguments is "
+"deprecated."
msgstr ""
-":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:"
-"`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。"
+":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` "
+"和 :meth:`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。"
#: ../../deprecations/pending-removal-in-3.14.rst:81
msgid ""
@@ -199,8 +202,9 @@ msgid ""
"instead. (Contributed by Nikita Sobolev in :gh:`97850`.)"
msgstr ""
":mod:`pkgutil`::func:`~pkgutil.find_loader` 和 :func:`~pkgutil.get_loader` "
-"現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util."
-"find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)"
+"現在會引發 :exc:`DeprecationWarning`;請改"
+"用 :func:`importlib.util.find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢"
+"獻。)"
#: ../../deprecations/pending-removal-in-3.14.rst:86
msgid ":mod:`pty`:"
@@ -224,9 +228,9 @@ msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。"
#: ../../deprecations/pending-removal-in-3.14.rst:95
msgid ""
-":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :"
-"ref:`named placeholders ` are used and *parameters* is "
-"a sequence instead of a :class:`dict`."
+":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` "
+"if :ref:`named placeholders ` are used and "
+"*parameters* is a sequence instead of a :class:`dict`."
msgstr ""
":meth:`~sqlite3.Cursor.execute` 和 :meth:`~sqlite3.Cursor.executemany`,如果"
"使用 :ref:`named placeholders ` 且 *parameters* 是序列"
@@ -243,8 +247,8 @@ msgstr ""
#: ../../deprecations/pending-removal-in-3.14.rst:102
msgid ""
":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not "
-"intended to be a public API. (Contributed by Gregory P. Smith in :gh:"
-"`88168`.)"
+"intended to be a public API. (Contributed by Gregory P. Smith "
+"in :gh:`88168`.)"
msgstr ""
":mod:`urllib`::class:`!urllib.parse.Quoter` 已被棄用:它並非預期的公開 API。"
"(由 Gregory P. Smith 於 :gh:`88168` 貢獻。)"
diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po
index 8c048042e0..726d403414 100644
--- a/deprecations/pending-removal-in-3.15.po
+++ b/deprecations/pending-removal-in-3.15.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-11-05 00:13+0000\n"
+"POT-Creation-Date: 2025-02-28 00:14+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -25,10 +25,10 @@ msgstr "引入系統 (import system):"
#: ../../deprecations/pending-removal-in-3.15.rst:6
msgid ""
-"Setting :attr:`~module.__cached__` on a module while failing to set :attr:"
-"`__spec__.cached ` is deprecated. In "
-"Python 3.15, :attr:`!__cached__` will cease to be set or take into "
-"consideration by the import system or standard library. (:gh:`97879`)"
+"Setting :attr:`~module.__cached__` on a module while failing to "
+"set :attr:`__spec__.cached ` is "
+"deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take "
+"into consideration by the import system or standard library. (:gh:`97879`)"
msgstr ""
"在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached "
"` 的做法已被棄用。在 Python 3.15 中,"
@@ -36,10 +36,11 @@ msgstr ""
#: ../../deprecations/pending-removal-in-3.15.rst:11
msgid ""
-"Setting :attr:`~module.__package__` on a module while failing to set :attr:"
-"`__spec__.parent ` is deprecated. In "
-"Python 3.15, :attr:`!__package__` will cease to be set or take into "
-"consideration by the import system or standard library. (:gh:`97879`)"
+"Setting :attr:`~module.__package__` on a module while failing to "
+"set :attr:`__spec__.parent ` is "
+"deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or "
+"take into consideration by the import system or standard library. "
+"(:gh:`97879`)"
msgstr ""
"在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent "
"` 的做法已被棄用。在 Python 3.15 中,"
@@ -79,39 +80,49 @@ msgstr ""
"cgi` 旗標已被棄用。"
#: ../../deprecations/pending-removal-in-3.15.rst:32
+msgid ":mod:`importlib`:"
+msgstr ":mod:`importlib`:"
+
+#: ../../deprecations/pending-removal-in-3.15.rst:34
+msgid "``load_module()`` method: use ``exec_module()`` instead."
+msgstr "``load_module()`` method:請改用 ``exec_module()``。"
+
+#: ../../deprecations/pending-removal-in-3.15.rst:36
msgid ":class:`locale`:"
msgstr ":class:`locale`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:34
+#: ../../deprecations/pending-removal-in-3.15.rst:38
msgid ""
"The :func:`~locale.getdefaultlocale` function has been deprecated since "
-"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:"
-"`90817`), but has been postponed to Python 3.15. Use :func:`~locale."
-"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` "
-"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)"
+"Python 3.11. Its removal was originally planned for Python 3.13 "
+"(:gh:`90817`), but has been postponed to Python 3.15. "
+"Use :func:`~locale.getlocale`, :func:`~locale.setlocale`, "
+"and :func:`~locale.getencoding` instead. (Contributed by Hugo van Kemenade "
+"in :gh:`111187`.)"
msgstr ""
":func:`~locale.getdefaultlocale` 已在 Python 3.11 中被棄用,原本計劃在 "
-"Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :func:"
-"`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale."
-"getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)"
+"Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改"
+"用 :func:`~locale.getlocale`、:func:`~locale.setlocale` "
+"和 :func:`~locale.getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢"
+"獻。)"
-#: ../../deprecations/pending-removal-in-3.15.rst:42
+#: ../../deprecations/pending-removal-in-3.15.rst:46
msgid ":mod:`pathlib`:"
msgstr ":mod:`pathlib`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:44
+#: ../../deprecations/pending-removal-in-3.15.rst:48
msgid ""
-":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :"
-"func:`os.path.isreserved` to detect reserved paths on Windows."
+":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. "
+"Use :func:`os.path.isreserved` to detect reserved paths on Windows."
msgstr ""
-":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path."
-"isreserved` 來偵測 Windows 上的保留路徑。"
+":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請"
+"用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。"
-#: ../../deprecations/pending-removal-in-3.15.rst:48
+#: ../../deprecations/pending-removal-in-3.15.rst:52
msgid ":mod:`platform`:"
msgstr ":mod:`platform`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:50
+#: ../../deprecations/pending-removal-in-3.15.rst:54
msgid ""
":func:`~platform.java_ver` has been deprecated since Python 3.13. This "
"function is only useful for Jython support, has a confusing API, and is "
@@ -120,11 +131,23 @@ msgstr ""
"自 Python 3.13 起,:func:`~platform.java_ver` 已被棄用。此函式僅對 Jython 支"
"援有用,具有令人困惑的 API,基本上未經測試。"
-#: ../../deprecations/pending-removal-in-3.15.rst:54
+#: ../../deprecations/pending-removal-in-3.15.rst:58
+msgid ":mod:`sysconfig`:"
+msgstr ":mod:`sysconfig`:"
+
+#: ../../deprecations/pending-removal-in-3.15.rst:60
+msgid ""
+"The *check_home* argument of :func:`sysconfig.is_python_build` has been "
+"deprecated since Python 3.12."
+msgstr ""
+":func:`sysconfig.is_python_build` 的 *check_home* 引數自 Python 3.12 起已被棄"
+"用。"
+
+#: ../../deprecations/pending-removal-in-3.15.rst:63
msgid ":mod:`threading`:"
msgstr ":mod:`threading`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:56
+#: ../../deprecations/pending-removal-in-3.15.rst:65
msgid ""
":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any "
"arguments has been deprecated since Python 3.14, as the Python version does "
@@ -135,11 +158,11 @@ msgstr ""
"起,傳遞任何引數的用法已被棄用,因為 Python 版本不允許任何引數,但 C 版本允許"
"任意數量的位置或關鍵字引數,並忽略每個引數。"
-#: ../../deprecations/pending-removal-in-3.15.rst:62
+#: ../../deprecations/pending-removal-in-3.15.rst:71
msgid ":mod:`types`:"
msgstr ":mod:`types`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:64
+#: ../../deprecations/pending-removal-in-3.15.rst:73
msgid ""
":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was "
"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, "
@@ -147,26 +170,26 @@ msgid ""
"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)"
msgstr ""
":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已"
-"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :"
-"exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:"
-"`101866` 貢獻。)"
+"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發"
+"出 :exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev "
+"於 :gh:`101866` 貢獻。)"
-#: ../../deprecations/pending-removal-in-3.15.rst:71
+#: ../../deprecations/pending-removal-in-3.15.rst:80
msgid ":mod:`typing`:"
msgstr ":mod:`typing`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:73
+#: ../../deprecations/pending-removal-in-3.15.rst:82
msgid ""
-"The undocumented keyword argument syntax for creating :class:`~typing."
-"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) "
-"has been deprecated since Python 3.13. Use the class-based syntax or the "
-"functional syntax instead."
+"The undocumented keyword argument syntax for "
+"creating :class:`~typing.NamedTuple` classes (e.g. ``Point = "
+"NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python "
+"3.13. Use the class-based syntax or the functional syntax instead."
msgstr ""
"用於建立 :class:`~typing.NamedTuple` 類別的未以文件記錄之關鍵字引數語法 "
"(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改"
"用基於類別的語法或函式語法 (functional syntax)。"
-#: ../../deprecations/pending-removal-in-3.15.rst:79
+#: ../../deprecations/pending-removal-in-3.15.rst:88
msgid ""
"The :func:`typing.no_type_check_decorator` decorator function has been "
"deprecated since Python 3.13. After eight years in the :mod:`typing` module, "
@@ -176,16 +199,17 @@ msgstr ""
"用。在 :mod:`typing` 模組中使用了八年之後,它尚未得到任何主要型別檢查器的支"
"援。"
-#: ../../deprecations/pending-removal-in-3.15.rst:84
+#: ../../deprecations/pending-removal-in-3.15.rst:93
msgid ":mod:`wave`:"
msgstr ":mod:`wave`:"
-#: ../../deprecations/pending-removal-in-3.15.rst:86
+#: ../../deprecations/pending-removal-in-3.15.rst:95
msgid ""
-"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave."
-"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:"
-"`~wave.Wave_write` classes have been deprecated since Python 3.13."
+"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, "
+"and :meth:`~wave.Wave_read.getmarkers` methods of "
+"the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been "
+"deprecated since Python 3.13."
msgstr ""
-"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別的 :meth:"
-"`~wave.Wave_read.getmark`、:meth:`!setmark` 和 :meth:`~wave.Wave_read."
-"getmarkers` 方法自 Python 3.13 被棄用。"
+"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別"
+"的 :meth:`~wave.Wave_read.getmark`、:meth:`!setmark` "
+"和 :meth:`~wave.Wave_read.getmarkers` 方法自 Python 3.13 被棄用。"
diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po
index 785fc0e03f..168f04617f 100644
--- a/deprecations/pending-removal-in-3.16.po
+++ b/deprecations/pending-removal-in-3.16.po
@@ -25,10 +25,10 @@ msgstr "引入系統 (import system):"
#: ../../deprecations/pending-removal-in-3.16.rst:6
msgid ""
-"Setting :attr:`~module.__loader__` on a module while failing to set :attr:"
-"`__spec__.loader ` is deprecated. In "
-"Python 3.16, :attr:`!__loader__` will cease to be set or taken into "
-"consideration by the import system or the standard library."
+"Setting :attr:`~module.__loader__` on a module while failing to "
+"set :attr:`__spec__.loader ` is "
+"deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or "
+"taken into consideration by the import system or the standard library."
msgstr ""
"在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader "
"` 的做法將於 Python 3.16 被棄用。在 "
@@ -59,8 +59,8 @@ msgid ""
"by Jiahao Li and Kumar Aditya in :gh:`122875`.)"
msgstr ""
":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除,請改"
-"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :"
-"gh:`122875` 貢獻。)"
+"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya "
+"於 :gh:`122875` 貢獻。)"
#: ../../deprecations/pending-removal-in-3.16.rst:26
msgid ":mod:`builtins`:"
diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po
index 9649475ba7..230bd84669 100644
--- a/deprecations/pending-removal-in-future.po
+++ b/deprecations/pending-removal-in-future.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-23 07:52+0800\n"
+"POT-Creation-Date: 2025-04-30 00:15+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -33,18 +33,14 @@ msgid ""
msgstr ":mod:`argparse`:已棄用巢狀引數群組和巢狀互斥群組。"
#: ../../deprecations/pending-removal-in-future.rst:10
-msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)"
-msgstr ":mod:`array` 的 ``'u'`` 格式碼 (:gh:`57281`)"
-
-#: ../../deprecations/pending-removal-in-future.rst:12
msgid ":mod:`builtins`:"
msgstr ":mod:`builtins`:"
-#: ../../deprecations/pending-removal-in-future.rst:14
+#: ../../deprecations/pending-removal-in-future.rst:12
msgid "``bool(NotImplemented)``."
msgstr "``bool(NotImplemented)``。"
-#: ../../deprecations/pending-removal-in-future.rst:15
+#: ../../deprecations/pending-removal-in-future.rst:13
msgid ""
"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature "
"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single "
@@ -53,7 +49,7 @@ msgstr ""
"產生器:``throw(type, exc, tb)`` 和 ``athrow(type, exc, tb)`` 簽名已被棄用:"
"請改用 ``throw(exc)`` 和 ``athrow(exc)``,為單引數簽名。"
-#: ../../deprecations/pending-removal-in-future.rst:18
+#: ../../deprecations/pending-removal-in-future.rst:16
msgid ""
"Currently Python accepts numeric literals immediately followed by keywords, "
"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and "
@@ -71,7 +67,7 @@ msgstr ""
"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版"
"本中,它將被更改為語法錯誤。(:gh:`87999`)"
-#: ../../deprecations/pending-removal-in-future.rst:26
+#: ../../deprecations/pending-removal-in-future.rst:24
msgid ""
"Support for ``__index__()`` and ``__int__()`` method returning non-int type: "
"these methods will be required to return an instance of a strict subclass "
@@ -80,7 +76,7 @@ msgstr ""
"``__index__()`` 和 ``__int__()`` 方法回傳非 int 型別的支援:這些方法將需要回"
"傳 :class:`int` 的嚴格子類別實例。"
-#: ../../deprecations/pending-removal-in-future.rst:29
+#: ../../deprecations/pending-removal-in-future.rst:27
msgid ""
"Support for ``__float__()`` method returning a strict subclass of :class:"
"`float`: these methods will be required to return an instance of :class:"
@@ -89,7 +85,7 @@ msgstr ""
"回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回"
"傳 :class:`float` 的實例。"
-#: ../../deprecations/pending-removal-in-future.rst:32
+#: ../../deprecations/pending-removal-in-future.rst:30
msgid ""
"Support for ``__complex__()`` method returning a strict subclass of :class:"
"`complex`: these methods will be required to return an instance of :class:"
@@ -98,11 +94,11 @@ msgstr ""
"回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要"
"回傳 :class:`complex` 的實例。"
-#: ../../deprecations/pending-removal-in-future.rst:35
+#: ../../deprecations/pending-removal-in-future.rst:33
msgid "Delegation of ``int()`` to ``__trunc__()`` method."
msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。"
-#: ../../deprecations/pending-removal-in-future.rst:36
+#: ../../deprecations/pending-removal-in-future.rst:34
msgid ""
"Passing a complex number as the *real* or *imag* argument in the :func:"
"`complex` constructor is now deprecated; it should only be passed as a "
@@ -112,7 +108,7 @@ msgstr ""
"在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;"
"它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:41
+#: ../../deprecations/pending-removal-in-future.rst:39
msgid ""
":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants "
"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar."
@@ -122,18 +118,18 @@ msgstr ""
"被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince "
"Roshan 於 :gh:`103636` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:46
+#: ../../deprecations/pending-removal-in-future.rst:44
msgid ""
":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method "
"instead."
msgstr ""
":attr:`codeobject.co_lnotab`:請改用 :meth:`codeobject.co_lines` 方法。"
-#: ../../deprecations/pending-removal-in-future.rst:49
+#: ../../deprecations/pending-removal-in-future.rst:47
msgid ":mod:`datetime`:"
msgstr ":mod:`datetime`:"
-#: ../../deprecations/pending-removal-in-future.rst:51
+#: ../../deprecations/pending-removal-in-future.rst:49
msgid ""
":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime."
"UTC)``."
@@ -141,7 +137,7 @@ msgstr ""
":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime."
"now(tz=datetime.UTC)``。"
-#: ../../deprecations/pending-removal-in-future.rst:53
+#: ../../deprecations/pending-removal-in-future.rst:51
msgid ""
":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime."
"fromtimestamp(timestamp, tz=datetime.UTC)``."
@@ -149,19 +145,15 @@ msgstr ""
":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime."
"fromtimestamp(timestamp, tz=datetime.UTC)``。"
-#: ../../deprecations/pending-removal-in-future.rst:56
+#: ../../deprecations/pending-removal-in-future.rst:54
msgid ":mod:`gettext`: Plural value must be an integer."
msgstr ":mod:`gettext`:複數值必須是整數。"
-#: ../../deprecations/pending-removal-in-future.rst:58
+#: ../../deprecations/pending-removal-in-future.rst:56
msgid ":mod:`importlib`:"
msgstr ":mod:`importlib`:"
-#: ../../deprecations/pending-removal-in-future.rst:60
-msgid "``load_module()`` method: use ``exec_module()`` instead."
-msgstr "``load_module()`` method:請改用 ``exec_module()``。"
-
-#: ../../deprecations/pending-removal-in-future.rst:61
+#: ../../deprecations/pending-removal-in-future.rst:58
msgid ""
":func:`~importlib.util.cache_from_source` *debug_override* parameter is "
"deprecated: use the *optimization* parameter instead."
@@ -169,19 +161,19 @@ msgstr ""
":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改"
"用 *optimization* 參數。"
-#: ../../deprecations/pending-removal-in-future.rst:64
+#: ../../deprecations/pending-removal-in-future.rst:61
msgid ":mod:`importlib.metadata`:"
msgstr ":mod:`importlib.metadata`:"
-#: ../../deprecations/pending-removal-in-future.rst:66
+#: ../../deprecations/pending-removal-in-future.rst:63
msgid "``EntryPoints`` tuple interface."
msgstr "``EntryPoints`` 元組介面。"
-#: ../../deprecations/pending-removal-in-future.rst:67
+#: ../../deprecations/pending-removal-in-future.rst:64
msgid "Implicit ``None`` on return values."
msgstr "回傳值上的隱式 ``None``。"
-#: ../../deprecations/pending-removal-in-future.rst:69
+#: ../../deprecations/pending-removal-in-future.rst:66
msgid ""
":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, "
"use :meth:`~logging.warning` instead."
@@ -189,19 +181,19 @@ msgstr ""
":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:"
"`~logging.warning`。"
-#: ../../deprecations/pending-removal-in-future.rst:72
+#: ../../deprecations/pending-removal-in-future.rst:69
msgid ""
":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use "
"BytesIO and binary mode instead."
msgstr ""
":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。"
-#: ../../deprecations/pending-removal-in-future.rst:75
+#: ../../deprecations/pending-removal-in-future.rst:72
msgid ""
":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process."
msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。"
-#: ../../deprecations/pending-removal-in-future.rst:77
+#: ../../deprecations/pending-removal-in-future.rst:74
msgid ""
":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is "
"deprecated, use an exception instance."
@@ -209,7 +201,7 @@ msgstr ""
":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外"
"實例。"
-#: ../../deprecations/pending-removal-in-future.rst:80
+#: ../../deprecations/pending-removal-in-future.rst:77
msgid ""
":mod:`re`: More strict rules are now applied for numerical group references "
"and group names in regular expressions. Only sequence of ASCII digits is "
@@ -221,12 +213,12 @@ msgstr ""
"有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能"
"包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)"
-#: ../../deprecations/pending-removal-in-future.rst:87
+#: ../../deprecations/pending-removal-in-future.rst:84
msgid ""
":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules."
msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。"
-#: ../../deprecations/pending-removal-in-future.rst:89
+#: ../../deprecations/pending-removal-in-future.rst:86
msgid ""
":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in "
"Python 3.12; use the *onexc* parameter instead."
@@ -234,15 +226,15 @@ msgstr ""
":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被"
"棄用;請改用 *onexc* 參數。"
-#: ../../deprecations/pending-removal-in-future.rst:92
+#: ../../deprecations/pending-removal-in-future.rst:89
msgid ":mod:`ssl` options and protocols:"
msgstr ":mod:`ssl` 選項和協定:"
-#: ../../deprecations/pending-removal-in-future.rst:94
+#: ../../deprecations/pending-removal-in-future.rst:91
msgid ":class:`ssl.SSLContext` without protocol argument is deprecated."
msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。"
-#: ../../deprecations/pending-removal-in-future.rst:95
+#: ../../deprecations/pending-removal-in-future.rst:92
msgid ""
":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:"
"`!selected_npn_protocol` are deprecated: use ALPN instead."
@@ -250,58 +242,51 @@ msgstr ""
":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:"
"`!selected_npn_protocol` 已被棄用:請改用 ALPN。"
-#: ../../deprecations/pending-removal-in-future.rst:98
+#: ../../deprecations/pending-removal-in-future.rst:95
msgid "``ssl.OP_NO_SSL*`` options"
msgstr "``ssl.OP_NO_SSL*`` 選項"
-#: ../../deprecations/pending-removal-in-future.rst:99
+#: ../../deprecations/pending-removal-in-future.rst:96
msgid "``ssl.OP_NO_TLS*`` options"
msgstr "``ssl.OP_NO_TLS*`` 選項"
-#: ../../deprecations/pending-removal-in-future.rst:100
+#: ../../deprecations/pending-removal-in-future.rst:97
msgid "``ssl.PROTOCOL_SSLv3``"
msgstr "``ssl.PROTOCOL_SSLv3``"
-#: ../../deprecations/pending-removal-in-future.rst:101
+#: ../../deprecations/pending-removal-in-future.rst:98
msgid "``ssl.PROTOCOL_TLS``"
msgstr "``ssl.PROTOCOL_TLS``"
-#: ../../deprecations/pending-removal-in-future.rst:102
+#: ../../deprecations/pending-removal-in-future.rst:99
msgid "``ssl.PROTOCOL_TLSv1``"
msgstr "``ssl.PROTOCOL_TLSv1``"
-#: ../../deprecations/pending-removal-in-future.rst:103
+#: ../../deprecations/pending-removal-in-future.rst:100
msgid "``ssl.PROTOCOL_TLSv1_1``"
msgstr "``ssl.PROTOCOL_TLSv1_1``"
-#: ../../deprecations/pending-removal-in-future.rst:104
+#: ../../deprecations/pending-removal-in-future.rst:101
msgid "``ssl.PROTOCOL_TLSv1_2``"
msgstr "``ssl.PROTOCOL_TLSv1_2``"
-#: ../../deprecations/pending-removal-in-future.rst:105
+#: ../../deprecations/pending-removal-in-future.rst:102
msgid "``ssl.TLSVersion.SSLv3``"
msgstr "``ssl.TLSVersion.SSLv3``"
-#: ../../deprecations/pending-removal-in-future.rst:106
+#: ../../deprecations/pending-removal-in-future.rst:103
msgid "``ssl.TLSVersion.TLSv1``"
msgstr "``ssl.TLSVersion.TLSv1``"
-#: ../../deprecations/pending-removal-in-future.rst:107
+#: ../../deprecations/pending-removal-in-future.rst:104
msgid "``ssl.TLSVersion.TLSv1_1``"
msgstr "``ssl.TLSVersion.TLSv1_1``"
-#: ../../deprecations/pending-removal-in-future.rst:109
-msgid ""
-":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and "
-"ignored."
-msgstr ""
-":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。"
-
-#: ../../deprecations/pending-removal-in-future.rst:112
+#: ../../deprecations/pending-removal-in-future.rst:106
msgid ":mod:`threading` methods:"
msgstr ":mod:`threading` 方法:"
-#: ../../deprecations/pending-removal-in-future.rst:114
+#: ../../deprecations/pending-removal-in-future.rst:108
msgid ""
":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition."
"notify_all`."
@@ -309,11 +294,11 @@ msgstr ""
":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition."
"notify_all`。"
-#: ../../deprecations/pending-removal-in-future.rst:115
+#: ../../deprecations/pending-removal-in-future.rst:109
msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`."
msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。"
-#: ../../deprecations/pending-removal-in-future.rst:116
+#: ../../deprecations/pending-removal-in-future.rst:110
msgid ""
":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :"
"attr:`threading.Thread.daemon` attribute."
@@ -321,7 +306,7 @@ msgstr ""
":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請"
"用 :attr:`threading.Thread.daemon` 屬性。"
-#: ../../deprecations/pending-removal-in-future.rst:118
+#: ../../deprecations/pending-removal-in-future.rst:112
msgid ""
":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :"
"attr:`threading.Thread.name` attribute."
@@ -329,20 +314,20 @@ msgstr ""
":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :"
"attr:`threading.Thread.name` 屬性。"
-#: ../../deprecations/pending-removal-in-future.rst:120
+#: ../../deprecations/pending-removal-in-future.rst:114
msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`."
msgstr ""
":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。"
-#: ../../deprecations/pending-removal-in-future.rst:121
+#: ../../deprecations/pending-removal-in-future.rst:115
msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`."
msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。"
-#: ../../deprecations/pending-removal-in-future.rst:123
+#: ../../deprecations/pending-removal-in-future.rst:117
msgid ":class:`typing.Text` (:gh:`92332`)."
msgstr ":class:`typing.Text` (:gh:`92332`)。"
-#: ../../deprecations/pending-removal-in-future.rst:125
+#: ../../deprecations/pending-removal-in-future.rst:119
msgid ""
":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a "
"value that is not ``None`` from a test case."
@@ -350,58 +335,58 @@ msgstr ""
":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已"
"被棄用。"
-#: ../../deprecations/pending-removal-in-future.rst:128
+#: ../../deprecations/pending-removal-in-future.rst:122
msgid ""
":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` "
"instead"
msgstr ""
":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。"
-#: ../../deprecations/pending-removal-in-future.rst:130
+#: ../../deprecations/pending-removal-in-future.rst:124
msgid "``splitattr()``"
msgstr "``splitattr()``"
-#: ../../deprecations/pending-removal-in-future.rst:131
+#: ../../deprecations/pending-removal-in-future.rst:125
msgid "``splithost()``"
msgstr "``splithost()``"
-#: ../../deprecations/pending-removal-in-future.rst:132
+#: ../../deprecations/pending-removal-in-future.rst:126
msgid "``splitnport()``"
msgstr "``splitnport()``"
-#: ../../deprecations/pending-removal-in-future.rst:133
+#: ../../deprecations/pending-removal-in-future.rst:127
msgid "``splitpasswd()``"
msgstr "``splitpasswd()``"
-#: ../../deprecations/pending-removal-in-future.rst:134
+#: ../../deprecations/pending-removal-in-future.rst:128
msgid "``splitport()``"
msgstr "``splitport()``"
-#: ../../deprecations/pending-removal-in-future.rst:135
+#: ../../deprecations/pending-removal-in-future.rst:129
msgid "``splitquery()``"
msgstr "``splitquery()``"
-#: ../../deprecations/pending-removal-in-future.rst:136
+#: ../../deprecations/pending-removal-in-future.rst:130
msgid "``splittag()``"
msgstr "``splittag()``"
-#: ../../deprecations/pending-removal-in-future.rst:137
+#: ../../deprecations/pending-removal-in-future.rst:131
msgid "``splittype()``"
msgstr "``splittype()``"
-#: ../../deprecations/pending-removal-in-future.rst:138
+#: ../../deprecations/pending-removal-in-future.rst:132
msgid "``splituser()``"
msgstr "``splituser()``"
-#: ../../deprecations/pending-removal-in-future.rst:139
+#: ../../deprecations/pending-removal-in-future.rst:133
msgid "``splitvalue()``"
msgstr "``splitvalue()``"
-#: ../../deprecations/pending-removal-in-future.rst:140
+#: ../../deprecations/pending-removal-in-future.rst:134
msgid "``to_bytes()``"
msgstr "``to_bytes()``"
-#: ../../deprecations/pending-removal-in-future.rst:142
+#: ../../deprecations/pending-removal-in-future.rst:136
msgid ""
":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:"
"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. "
@@ -411,13 +396,13 @@ msgstr ""
"class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:"
"`~urllib.request.urlopen` 函式和方法。"
-#: ../../deprecations/pending-removal-in-future.rst:146
+#: ../../deprecations/pending-removal-in-future.rst:140
msgid ""
":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial "
"writes."
msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。"
-#: ../../deprecations/pending-removal-in-future.rst:149
+#: ../../deprecations/pending-removal-in-future.rst:143
msgid ""
":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml."
"etree.ElementTree.Element` is deprecated. In a future release it will always "
@@ -428,10 +413,13 @@ msgstr ""
"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 "
"``len(elem)`` 或 ``elem is not None`` 測試。"
-#: ../../deprecations/pending-removal-in-future.rst:154
+#: ../../deprecations/pending-removal-in-future.rst:148
msgid ""
":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:"
"`~zipimport.zipimporter.exec_module` instead."
msgstr ""
":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport."
"zipimporter.exec_module`。"
+
+#~ msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)"
+#~ msgstr ":mod:`array` 的 ``'u'`` 格式碼 (:gh:`57281`)"
diff --git a/extending/embedding.po b/extending/embedding.po
index ac486c5aef..4f1244dc1c 100644
--- a/extending/embedding.po
+++ b/extending/embedding.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-23 07:52+0800\n"
+"POT-Creation-Date: 2025-03-07 15:49+0000\n"
"PO-Revision-Date: 2018-05-23 14:09+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -356,7 +356,7 @@ msgstr ""
msgid ""
"After initializing the interpreter, the script is loaded using :c:func:"
"`PyImport_Import`. This routine needs a Python string as its argument, "
-"which is constructed using the :c:func:`PyUnicode_FromString` data "
+"which is constructed using the :c:func:`PyUnicode_DecodeFSDefault` data "
"conversion routine. ::"
msgstr ""
diff --git a/extending/extending.po b/extending/extending.po
index 2daee5badc..da956c0dc4 100644
--- a/extending/extending.po
+++ b/extending/extending.po
@@ -101,9 +101,9 @@ msgstr ""
#: ../../extending/extending.rst:53
msgid ""
"Begin by creating a file :file:`spammodule.c`. (Historically, if a module "
-"is called ``spam``, the C file containing its implementation is called :file:"
-"`spammodule.c`; if the module name is very long, like ``spammify``, the "
-"module name can be just :file:`spammify.c`.)"
+"is called ``spam``, the C file containing its implementation is "
+"called :file:`spammodule.c`; if the module name is very long, like "
+"``spammify``, the module name can be just :file:`spammify.c`.)"
msgstr ""
"首先建立一個檔案 :file:`spammodule.c`。(從過去歷史來看,如果一個模組叫做 "
"``spam``,包含其實作的 C 檔案就會叫做 :file:`spammodule.c`;如果模組名稱很"
@@ -153,11 +153,11 @@ msgstr ""
msgid ""
"All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` "
"or ``PY``, except those defined in standard header files. For convenience, "
-"and since they are used extensively by the Python interpreter, ``\"Python."
-"h\"`` includes a few standard header files: ````, ````, "
-"````, and ````. If the latter header file does not exist "
-"on your system, it declares the functions :c:func:`malloc`, :c:func:`free` "
-"and :c:func:`realloc` directly."
+"and since they are used extensively by the Python interpreter, "
+"``\"Python.h\"`` includes a few standard header files: ````, "
+"````, ````, and ````. If the latter header "
+"file does not exist on your system, it declares the "
+"functions :c:func:`malloc`, :c:func:`free` and :c:func:`realloc` directly."
msgstr ""
"除了那些在標準標頭檔中定義的符號以外,所有由 :file:`Python.h` 定義的使用者可"
"見符號 (user-visible symbols) 的前綴都是 ``Py`` 或 ``PY``。為了方便,也因為 "
@@ -295,10 +295,10 @@ msgstr ""
msgid ""
"Another useful function is :c:func:`PyErr_SetFromErrno`, which only takes an "
"exception argument and constructs the associated value by inspection of the "
-"global variable :c:data:`errno`. The most general function is :c:func:"
-"`PyErr_SetObject`, which takes two object arguments, the exception and its "
-"associated value. You don't need to :c:func:`Py_INCREF` the objects passed "
-"to any of these functions."
+"global variable :c:data:`errno`. The most general function "
+"is :c:func:`PyErr_SetObject`, which takes two object arguments, the "
+"exception and its associated value. You don't need to :c:func:`Py_INCREF` "
+"the objects passed to any of these functions."
msgstr ""
"另一個有用的函式是 :c:func:`PyErr_SetFromErrno`,它只接受一個例外引數,並透過"
"檢查全域變數 :c:data:`errno` 來建立關聯值。最一般的函式"
@@ -307,14 +307,14 @@ msgstr ""
#: ../../extending/extending.rst:154
msgid ""
-"You can test non-destructively whether an exception has been set with :c:"
-"func:`PyErr_Occurred`. This returns the current exception object, or "
-"``NULL`` if no exception has occurred. You normally don't need to call :c:"
-"func:`PyErr_Occurred` to see whether an error occurred in a function call, "
-"since you should be able to tell from the return value."
+"You can test non-destructively whether an exception has been set "
+"with :c:func:`PyErr_Occurred`. This returns the current exception object, "
+"or ``NULL`` if no exception has occurred. You normally don't need to "
+"call :c:func:`PyErr_Occurred` to see whether an error occurred in a function "
+"call, since you should be able to tell from the return value."
msgstr ""
"你可以使用 :c:func:`PyErr_Occurred` 來不具破壞性地測試例外是否已被設定。這會"
-"回傳當前的例外物件,如果沒有例外發生則回傳 ``NULL``。你通常不需要呼"
+"回傳目前的例外物件,如果沒有例外發生則回傳 ``NULL``。你通常不需要呼"
"叫 :c:func:`PyErr_Occurred` 來查看函式呼叫是否發生錯誤,因為你應可從回傳值就"
"得知。"
@@ -365,10 +365,11 @@ msgstr ""
#: ../../extending/extending.rst:182
msgid ""
"Every failing :c:func:`malloc` call must be turned into an exception --- the "
-"direct caller of :c:func:`malloc` (or :c:func:`realloc`) must call :c:func:"
-"`PyErr_NoMemory` and return a failure indicator itself. All the object-"
-"creating functions (for example, :c:func:`PyLong_FromLong`) already do this, "
-"so this note is only relevant to those who call :c:func:`malloc` directly."
+"direct caller of :c:func:`malloc` (or :c:func:`realloc`) must "
+"call :c:func:`PyErr_NoMemory` and return a failure indicator itself. All "
+"the object-creating functions (for example, :c:func:`PyLong_FromLong`) "
+"already do this, so this note is only relevant to those who "
+"call :c:func:`malloc` directly."
msgstr ""
"每個失敗的 :c:func:`malloc` 呼叫都必須被轉換成一個例外 "
"--- :c:func:`malloc`\\ (或 :c:func:`realloc`)的直接呼叫者必須呼"
@@ -389,8 +390,8 @@ msgstr ""
#: ../../extending/extending.rst:192
msgid ""
-"Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` or :"
-"c:func:`Py_DECREF` calls for objects you have already created) when you "
+"Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` "
+"or :c:func:`Py_DECREF` calls for objects you have already created) when you "
"return an error indicator!"
msgstr ""
"最後,在回傳錯誤指示器時要注意垃圾清理(透過對你已經建立的物件呼"
@@ -402,11 +403,12 @@ msgid ""
"predeclared C objects corresponding to all built-in Python exceptions, such "
"as :c:data:`PyExc_ZeroDivisionError`, which you can use directly. Of course, "
"you should choose exceptions wisely --- don't use :c:data:`PyExc_TypeError` "
-"to mean that a file couldn't be opened (that should probably be :c:data:"
-"`PyExc_OSError`). If something's wrong with the argument list, the :c:func:"
-"`PyArg_ParseTuple` function usually raises :c:data:`PyExc_TypeError`. If "
-"you have an argument whose value must be in a particular range or must "
-"satisfy other conditions, :c:data:`PyExc_ValueError` is appropriate."
+"to mean that a file couldn't be opened (that should probably "
+"be :c:data:`PyExc_OSError`). If something's wrong with the argument list, "
+"the :c:func:`PyArg_ParseTuple` function usually "
+"raises :c:data:`PyExc_TypeError`. If you have an argument whose value must "
+"be in a particular range or must satisfy other "
+"conditions, :c:data:`PyExc_ValueError` is appropriate."
msgstr ""
"你完全可以自行選擇要產生的例外。有一些預先宣告的 C 物件會對應到所有內建的 "
"Python 例外,例如 :c:data:`PyExc_ZeroDivisionError`,你可以直接使用它們。當"
@@ -600,8 +602,8 @@ msgstr "sts = system(command);"
#: ../../extending/extending.rst:292
msgid ""
"Our :func:`!spam.system` function must return the value of :c:data:`!sts` as "
-"a Python object. This is done using the function :c:func:"
-"`PyLong_FromLong`. ::"
+"a Python object. This is done using the "
+"function :c:func:`PyLong_FromLong`. ::"
msgstr ""
"我們的 :func:`!spam.system` 函式必須以 Python 物件的形式來回傳 :c:data:`!"
"sts` 的值。這是透過 :c:func:`PyLong_FromLong` 函式來達成。 ::"
@@ -622,8 +624,8 @@ msgstr ""
msgid ""
"If you have a C function that returns no useful argument (a function "
"returning :c:expr:`void`), the corresponding Python function must return "
-"``None``. You need this idiom to do so (which is implemented by the :c:"
-"macro:`Py_RETURN_NONE` macro)::"
+"``None``. You need this idiom to do so (which is implemented by "
+"the :c:macro:`Py_RETURN_NONE` macro)::"
msgstr ""
"如果你有一個不回傳任何有用引數的 C 函式(一個回傳 :c:expr:`void` 的函式),對"
"應的 Python 函式必須回傳 ``None``。你需要以下這個慣例來達成"
@@ -692,8 +694,9 @@ msgstr ""
#: ../../extending/extending.rst:334
msgid ""
"When using only ``METH_VARARGS``, the function should expect the Python-"
-"level parameters to be passed in as a tuple acceptable for parsing via :c:"
-"func:`PyArg_ParseTuple`; more information on this function is provided below."
+"level parameters to be passed in as a tuple acceptable for parsing "
+"via :c:func:`PyArg_ParseTuple`; more information on this function is "
+"provided below."
msgstr ""
"當只使用 ``METH_VARARGS`` 時,函式應預期 Python 層級的參數是以元組形式傳入且"
"能夠接受以 :c:func:`PyArg_ParseTuple` 進行剖析;有關此函式的更多資訊將在下面"
@@ -740,9 +743,9 @@ msgstr ""
#: ../../extending/extending.rst:355
msgid ""
"This structure, in turn, must be passed to the interpreter in the module's "
-"initialization function. The initialization function must be named :c:func:"
-"`!PyInit_name`, where *name* is the name of the module, and should be the "
-"only non-\\ ``static`` item defined in the module file::"
+"initialization function. The initialization function must be "
+"named :c:func:`!PyInit_name`, where *name* is the name of the module, and "
+"should be the only non-\\ ``static`` item defined in the module file::"
msgstr ""
"反過來說,這個結構必須在模組的初始化函式中被傳給直譯器。初始化函式必須被命名"
"為 :c:func:`!PyInit_name`,其中 *name* 是模組的名稱,且應該是模組檔案中唯一定"
@@ -768,21 +771,21 @@ msgid ""
"return type, declares any special linkage declarations required by the "
"platform, and for C++ declares the function as ``extern \"C\"``."
msgstr ""
-"請注意,:c:macro:`PyMODINIT_FUNC` 宣告函式的回傳型別為 `PyObject *``、宣告平"
+"請注意,:c:macro:`PyMODINIT_FUNC` 宣告函式的回傳型別為 ``PyObject *``、宣告平"
"台所需的任何特殊連結宣告、並針對 C++ 宣告函式為 ``extern \"C\"``。"
#: ../../extending/extending.rst:370
msgid ""
-"When the Python program imports module :mod:`!spam` for the first time, :c:"
-"func:`!PyInit_spam` is called. (See below for comments about embedding "
-"Python.) It calls :c:func:`PyModule_Create`, which returns a module object, "
-"and inserts built-in function objects into the newly created module based "
-"upon the table (an array of :c:type:`PyMethodDef` structures) found in the "
-"module definition. :c:func:`PyModule_Create` returns a pointer to the module "
-"object that it creates. It may abort with a fatal error for certain errors, "
-"or return ``NULL`` if the module could not be initialized satisfactorily. "
-"The init function must return the module object to its caller, so that it "
-"then gets inserted into ``sys.modules``."
+"When the Python program imports module :mod:`!spam` for the first "
+"time, :c:func:`!PyInit_spam` is called. (See below for comments about "
+"embedding Python.) It calls :c:func:`PyModule_Create`, which returns a "
+"module object, and inserts built-in function objects into the newly created "
+"module based upon the table (an array of :c:type:`PyMethodDef` structures) "
+"found in the module definition. :c:func:`PyModule_Create` returns a pointer "
+"to the module object that it creates. It may abort with a fatal error for "
+"certain errors, or return ``NULL`` if the module could not be initialized "
+"satisfactorily. The init function must return the module object to its "
+"caller, so that it then gets inserted into ``sys.modules``."
msgstr ""
"當 Python 程式第一次引入模組 :mod:`!spam` 時,:c:func:`!PyInit_spam` 會被呼"
"叫。(有關嵌入 Python 的註解請參見下文。)它會呼叫回傳一個模組物件"
@@ -797,8 +800,9 @@ msgstr ""
msgid ""
"When embedding Python, the :c:func:`!PyInit_spam` function is not called "
"automatically unless there's an entry in the :c:data:`PyImport_Inittab` "
-"table. To add the module to the initialization table, use :c:func:"
-"`PyImport_AppendInittab`, optionally followed by an import of the module::"
+"table. To add the module to the initialization table, "
+"use :c:func:`PyImport_AppendInittab`, optionally followed by an import of "
+"the module::"
msgstr ""
"嵌入 Python 時,除非在 :c:data:`PyImport_Inittab` 表中有相關條目,否則不會自"
"動呼叫 :c:func:`!PyInit_spam` 函式。要將模組加入初始化表,請使"
@@ -948,9 +952,10 @@ msgid ""
"There are two more things to do before you can use your new extension: "
"compiling and linking it with the Python system. If you use dynamic "
"loading, the details may depend on the style of dynamic loading your system "
-"uses; see the chapters about building extension modules (chapter :ref:"
-"`building`) and additional information that pertains only to building on "
-"Windows (chapter :ref:`building-on-windows`) for more information about this."
+"uses; see the chapters about building extension modules "
+"(chapter :ref:`building`) and additional information that pertains only to "
+"building on Windows (chapter :ref:`building-on-windows`) for more "
+"information about this."
msgstr ""
#: ../../extending/extending.rst:466
@@ -1049,10 +1054,10 @@ msgstr ""
#: ../../extending/extending.rst:540
msgid ""
-"This function must be registered with the interpreter using the :c:macro:"
-"`METH_VARARGS` flag; this is described in section :ref:`methodtable`. The :"
-"c:func:`PyArg_ParseTuple` function and its arguments are documented in "
-"section :ref:`parsetuple`."
+"This function must be registered with the interpreter using "
+"the :c:macro:`METH_VARARGS` flag; this is described in "
+"section :ref:`methodtable`. The :c:func:`PyArg_ParseTuple` function and its "
+"arguments are documented in section :ref:`parsetuple`."
msgstr ""
#: ../../extending/extending.rst:545
@@ -1065,14 +1070,15 @@ msgstr ""
#: ../../extending/extending.rst:552
msgid ""
-"Later, when it is time to call the function, you call the C function :c:func:"
-"`PyObject_CallObject`. This function has two arguments, both pointers to "
-"arbitrary Python objects: the Python function, and the argument list. The "
-"argument list must always be a tuple object, whose length is the number of "
-"arguments. To call the Python function with no arguments, pass in ``NULL``, "
-"or an empty tuple; to call it with one argument, pass a singleton tuple. :c:"
-"func:`Py_BuildValue` returns a tuple when its format string consists of zero "
-"or more format codes between parentheses. For example::"
+"Later, when it is time to call the function, you call the C "
+"function :c:func:`PyObject_CallObject`. This function has two arguments, "
+"both pointers to arbitrary Python objects: the Python function, and the "
+"argument list. The argument list must always be a tuple object, whose "
+"length is the number of arguments. To call the Python function with no "
+"arguments, pass in ``NULL``, or an empty tuple; to call it with one "
+"argument, pass a singleton tuple. :c:func:`Py_BuildValue` returns a tuple "
+"when its format string consists of zero or more format codes between "
+"parentheses. For example::"
msgstr ""
#: ../../extending/extending.rst:561
@@ -1094,8 +1100,9 @@ msgid ""
":c:func:`PyObject_CallObject` returns a Python object pointer: this is the "
"return value of the Python function. :c:func:`PyObject_CallObject` is "
"\"reference-count-neutral\" with respect to its arguments. In the example a "
-"new tuple was created to serve as the argument list, which is :c:func:"
-"`Py_DECREF`\\ -ed immediately after the :c:func:`PyObject_CallObject` call."
+"new tuple was created to serve as the argument list, which "
+"is :c:func:`Py_DECREF`\\ -ed immediately after "
+"the :c:func:`PyObject_CallObject` call."
msgstr ""
#: ../../extending/extending.rst:579
@@ -1161,9 +1168,10 @@ msgstr ""
#: ../../extending/extending.rst:621
msgid ""
-"You may also call a function with keyword arguments by using :c:func:"
-"`PyObject_Call`, which supports arguments and keyword arguments. As in the "
-"above example, we use :c:func:`Py_BuildValue` to construct the dictionary. ::"
+"You may also call a function with keyword arguments by "
+"using :c:func:`PyObject_Call`, which supports arguments and keyword "
+"arguments. As in the above example, we use :c:func:`Py_BuildValue` to "
+"construct the dictionary. ::"
msgstr ""
#: ../../extending/extending.rst:625
@@ -1316,21 +1324,21 @@ msgstr ""
#: ../../extending/extending.rst:740
msgid ""
-"The *arg* and *format* parameters are identical to those of the :c:func:"
-"`PyArg_ParseTuple` function. The *kwdict* parameter is the dictionary of "
-"keywords received as the third parameter from the Python runtime. The "
-"*kwlist* parameter is a ``NULL``-terminated list of strings which identify "
-"the parameters; the names are matched with the type information from "
-"*format* from left to right. On success, :c:func:"
-"`PyArg_ParseTupleAndKeywords` returns true, otherwise it returns false and "
-"raises an appropriate exception."
+"The *arg* and *format* parameters are identical to those of "
+"the :c:func:`PyArg_ParseTuple` function. The *kwdict* parameter is the "
+"dictionary of keywords received as the third parameter from the Python "
+"runtime. The *kwlist* parameter is a ``NULL``-terminated list of strings "
+"which identify the parameters; the names are matched with the type "
+"information from *format* from left to right. On "
+"success, :c:func:`PyArg_ParseTupleAndKeywords` returns true, otherwise it "
+"returns false and raises an appropriate exception."
msgstr ""
#: ../../extending/extending.rst:750
msgid ""
"Nested tuples cannot be parsed when using keyword arguments! Keyword "
-"parameters passed in which are not present in the *kwlist* will cause :exc:"
-"`TypeError` to be raised."
+"parameters passed in which are not present in the *kwlist* will "
+"cause :exc:`TypeError` to be raised."
msgstr ""
#: ../../extending/extending.rst:756
@@ -1409,10 +1417,10 @@ msgstr "PyObject *Py_BuildValue(const char *format, ...);"
#: ../../extending/extending.rst:818
msgid ""
-"It recognizes a set of format units similar to the ones recognized by :c:"
-"func:`PyArg_ParseTuple`, but the arguments (which are input to the function, "
-"not output) must not be pointers, just values. It returns a new Python "
-"object, suitable for returning from a C function called from Python."
+"It recognizes a set of format units similar to the ones recognized "
+"by :c:func:`PyArg_ParseTuple`, but the arguments (which are input to the "
+"function, not output) must not be pointers, just values. It returns a new "
+"Python object, suitable for returning from a C function called from Python."
msgstr ""
#: ../../extending/extending.rst:823
@@ -1486,16 +1494,16 @@ msgstr ""
#: ../../extending/extending.rst:865
msgid ""
"Every block of memory allocated with :c:func:`malloc` should eventually be "
-"returned to the pool of available memory by exactly one call to :c:func:"
-"`free`. It is important to call :c:func:`free` at the right time. If a "
-"block's address is forgotten but :c:func:`free` is not called for it, the "
-"memory it occupies cannot be reused until the program terminates. This is "
-"called a :dfn:`memory leak`. On the other hand, if a program calls :c:func:"
-"`free` for a block and then continues to use the block, it creates a "
-"conflict with reuse of the block through another :c:func:`malloc` call. "
-"This is called :dfn:`using freed memory`. It has the same bad consequences "
-"as referencing uninitialized data --- core dumps, wrong results, mysterious "
-"crashes."
+"returned to the pool of available memory by exactly one call "
+"to :c:func:`free`. It is important to call :c:func:`free` at the right "
+"time. If a block's address is forgotten but :c:func:`free` is not called "
+"for it, the memory it occupies cannot be reused until the program "
+"terminates. This is called a :dfn:`memory leak`. On the other hand, if a "
+"program calls :c:func:`free` for a block and then continues to use the "
+"block, it creates a conflict with reuse of the block through "
+"another :c:func:`malloc` call. This is called :dfn:`using freed memory`. It "
+"has the same bad consequences as referencing uninitialized data --- core "
+"dumps, wrong results, mysterious crashes."
msgstr ""
#: ../../extending/extending.rst:876
@@ -1559,9 +1567,9 @@ msgstr ""
#: ../../extending/extending.rst:920
msgid ""
"The cycle detector is able to detect garbage cycles and can reclaim them. "
-"The :mod:`gc` module exposes a way to run the detector (the :func:`~gc."
-"collect` function), as well as configuration interfaces and the ability to "
-"disable the detector at runtime."
+"The :mod:`gc` module exposes a way to run the detector "
+"(the :func:`~gc.collect` function), as well as configuration interfaces and "
+"the ability to disable the detector at runtime."
msgstr ""
#: ../../extending/extending.rst:929
@@ -1571,12 +1579,12 @@ msgstr ""
#: ../../extending/extending.rst:931
msgid ""
"There are two macros, ``Py_INCREF(x)`` and ``Py_DECREF(x)``, which handle "
-"the incrementing and decrementing of the reference count. :c:func:"
-"`Py_DECREF` also frees the object when the count reaches zero. For "
-"flexibility, it doesn't call :c:func:`free` directly --- rather, it makes a "
-"call through a function pointer in the object's :dfn:`type object`. For "
-"this purpose (and others), every object also contains a pointer to its type "
-"object."
+"the incrementing and decrementing of the reference "
+"count. :c:func:`Py_DECREF` also frees the object when the count reaches "
+"zero. For flexibility, it doesn't call :c:func:`free` directly --- rather, "
+"it makes a call through a function pointer in the object's :dfn:`type "
+"object`. For this purpose (and others), every object also contains a "
+"pointer to its type object."
msgstr ""
#: ../../extending/extending.rst:938
@@ -1614,11 +1622,11 @@ msgstr ""
#: ../../extending/extending.rst:961
msgid ""
-"A borrowed reference can be changed into an owned reference by calling :c:"
-"func:`Py_INCREF`. This does not affect the status of the owner from which "
-"the reference was borrowed --- it creates a new owned reference, and gives "
-"full owner responsibilities (the new owner must dispose of the reference "
-"properly, as well as the previous owner)."
+"A borrowed reference can be changed into an owned reference by "
+"calling :c:func:`Py_INCREF`. This does not affect the status of the owner "
+"from which the reference was borrowed --- it creates a new owned reference, "
+"and gives full owner responsibilities (the new owner must dispose of the "
+"reference properly, as well as the previous owner)."
msgstr ""
#: ../../extending/extending.rst:971
@@ -1638,20 +1646,20 @@ msgid ""
"the reference. In particular, all functions whose function it is to create "
"a new object, such as :c:func:`PyLong_FromLong` and :c:func:`Py_BuildValue`, "
"pass ownership to the receiver. Even if the object is not actually new, you "
-"still receive ownership of a new reference to that object. For instance, :c:"
-"func:`PyLong_FromLong` maintains a cache of popular values and can return a "
-"reference to a cached item."
+"still receive ownership of a new reference to that object. For "
+"instance, :c:func:`PyLong_FromLong` maintains a cache of popular values and "
+"can return a reference to a cached item."
msgstr ""
#: ../../extending/extending.rst:985
msgid ""
"Many functions that extract objects from other objects also transfer "
-"ownership with the reference, for instance :c:func:"
-"`PyObject_GetAttrString`. The picture is less clear, here, however, since a "
-"few common routines are exceptions: :c:func:`PyTuple_GetItem`, :c:func:"
-"`PyList_GetItem`, :c:func:`PyDict_GetItem`, and :c:func:"
-"`PyDict_GetItemString` all return references that you borrow from the tuple, "
-"list or dictionary."
+"ownership with the reference, for "
+"instance :c:func:`PyObject_GetAttrString`. The picture is less clear, here, "
+"however, since a few common routines are "
+"exceptions: :c:func:`PyTuple_GetItem`, :c:func:`PyList_GetItem`, :c:func:`PyDict_GetItem`, "
+"and :c:func:`PyDict_GetItemString` all return references that you borrow "
+"from the tuple, list or dictionary."
msgstr ""
#: ../../extending/extending.rst:992
@@ -1666,10 +1674,11 @@ msgid ""
"When you pass an object reference into another function, in general, the "
"function borrows the reference from you --- if it needs to store it, it will "
"use :c:func:`Py_INCREF` to become an independent owner. There are exactly "
-"two important exceptions to this rule: :c:func:`PyTuple_SetItem` and :c:func:"
-"`PyList_SetItem`. These functions take over ownership of the item passed to "
-"them --- even if they fail! (Note that :c:func:`PyDict_SetItem` and friends "
-"don't take over ownership --- they are \"normal.\")"
+"two important exceptions to this rule: :c:func:`PyTuple_SetItem` "
+"and :c:func:`PyList_SetItem`. These functions take over ownership of the "
+"item passed to them --- even if they fail! (Note "
+"that :c:func:`PyDict_SetItem` and friends don't take over ownership --- they "
+"are \"normal.\")"
msgstr ""
#: ../../extending/extending.rst:1004
@@ -1844,8 +1853,8 @@ msgstr ""
#: ../../extending/extending.rst:1110
msgid ""
"The macros :c:func:`Py_INCREF` and :c:func:`Py_DECREF` do not check for "
-"``NULL`` pointers --- however, their variants :c:func:`Py_XINCREF` and :c:"
-"func:`Py_XDECREF` do."
+"``NULL`` pointers --- however, their variants :c:func:`Py_XINCREF` "
+"and :c:func:`Py_XDECREF` do."
msgstr ""
#: ../../extending/extending.rst:1114
@@ -2173,9 +2182,9 @@ msgstr ""
#: ../../extending/extending.rst:1344
msgid ""
-"All that a client module must do in order to have access to the function :c:"
-"func:`!PySpam_System` is to call the function (or rather macro) :c:func:`!"
-"import_spam` in its initialization function::"
+"All that a client module must do in order to have access to the "
+"function :c:func:`!PySpam_System` is to call the function (or rather "
+"macro) :c:func:`!import_spam` in its initialization function::"
msgstr ""
#: ../../extending/extending.rst:1348
@@ -2214,12 +2223,12 @@ msgstr ""
#: ../../extending/extending.rst:1374
msgid "Footnotes"
-msgstr "註解"
+msgstr "註腳"
#: ../../extending/extending.rst:1375
msgid ""
-"An interface for this function already exists in the standard module :mod:"
-"`os` --- it was chosen as a simple and straightforward example."
+"An interface for this function already exists in the standard "
+"module :mod:`os` --- it was chosen as a simple and straightforward example."
msgstr ""
#: ../../extending/extending.rst:1378
diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po
index d344eb253f..3481c835b2 100644
--- a/extending/newtypes_tutorial.po
+++ b/extending/newtypes_tutorial.po
@@ -33,14 +33,14 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:26
msgid ""
-"The :term:`CPython` runtime sees all Python objects as variables of type :c:"
-"expr:`PyObject*`, which serves as a \"base type\" for all Python objects. "
-"The :c:type:`PyObject` structure itself only contains the object's :term:"
-"`reference count` and a pointer to the object's \"type object\". This is "
-"where the action is; the type object determines which (C) functions get "
-"called by the interpreter when, for instance, an attribute gets looked up on "
-"an object, a method called, or it is multiplied by another object. These C "
-"functions are called \"type methods\"."
+"The :term:`CPython` runtime sees all Python objects as variables of "
+"type :c:expr:`PyObject*`, which serves as a \"base type\" for all Python "
+"objects. The :c:type:`PyObject` structure itself only contains the "
+"object's :term:`reference count` and a pointer to the object's \"type "
+"object\". This is where the action is; the type object determines which (C) "
+"functions get called by the interpreter when, for instance, an attribute "
+"gets looked up on an object, a method called, or it is multiplied by another "
+"object. These C functions are called \"type methods\"."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:35
@@ -60,8 +60,8 @@ msgstr ""
msgid ""
"What we're showing here is the traditional way of defining *static* "
"extension types. It should be adequate for most uses. The C API also "
-"allows defining heap-allocated extension types using the :c:func:"
-"`PyType_FromSpec` function, which isn't covered in this tutorial."
+"allows defining heap-allocated extension types using "
+"the :c:func:`PyType_FromSpec` function, which isn't covered in this tutorial."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:48
@@ -264,9 +264,10 @@ msgstr ""
msgid ""
"Note that the name is a dotted name that includes both the module name and "
"the name of the type within the module. The module in this case is :mod:`!"
-"custom` and the type is :class:`!Custom`, so we set the type name to :class:"
-"`!custom.Custom`. Using the real dotted import path is important to make "
-"your type compatible with the :mod:`pydoc` and :mod:`pickle` modules. ::"
+"custom` and the type is :class:`!Custom`, so we set the type name "
+"to :class:`!custom.Custom`. Using the real dotted import path is important "
+"to make your type compatible with the :mod:`pydoc` and :mod:`pickle` "
+"modules. ::"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:135
@@ -279,9 +280,9 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:138
msgid ""
-"This is so that Python knows how much memory to allocate when creating new :"
-"class:`!Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is only "
-"used for variable-sized objects and should otherwise be zero."
+"This is so that Python knows how much memory to allocate when creating "
+"new :class:`!Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is "
+"only used for variable-sized objects and should otherwise be zero."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:144
@@ -324,11 +325,11 @@ msgstr ".tp_doc = PyDoc_STR(\"Custom objects\"),"
#: ../../extending/newtypes_tutorial.rst:166
msgid ""
-"To enable object creation, we have to provide a :c:member:`~PyTypeObject."
-"tp_new` handler. This is the equivalent of the Python method :meth:`~object."
-"__new__`, but has to be specified explicitly. In this case, we can just use "
-"the default implementation provided by the API function :c:func:"
-"`PyType_GenericNew`. ::"
+"To enable object creation, we have to provide "
+"a :c:member:`~PyTypeObject.tp_new` handler. This is the equivalent of the "
+"Python method :meth:`~object.__new__`, but has to be specified explicitly. "
+"In this case, we can just use the default implementation provided by the API "
+"function :c:func:`PyType_GenericNew`. ::"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:171
@@ -337,8 +338,8 @@ msgstr ".tp_new = PyType_GenericNew,"
#: ../../extending/newtypes_tutorial.rst:173
msgid ""
-"Everything else in the file should be familiar, except for some code in :c:"
-"func:`!PyInit_custom`::"
+"Everything else in the file should be familiar, except for some code "
+"in :c:func:`!PyInit_custom`::"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:176
@@ -357,24 +358,21 @@ msgid ""
msgstr ""
#: ../../extending/newtypes_tutorial.rst:183
-#, fuzzy
msgid ""
"if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n"
" Py_DECREF(m);\n"
" return NULL;\n"
"}"
msgstr ""
-"Py_INCREF(&CustomType);\n"
-"if (PyModule_AddObject(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n"
-" Py_DECREF(&CustomType);\n"
+"if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n"
" Py_DECREF(m);\n"
" return NULL;\n"
"}"
#: ../../extending/newtypes_tutorial.rst:188
msgid ""
-"This adds the type to the module dictionary. This allows us to create :"
-"class:`!Custom` instances by calling the :class:`!Custom` class:"
+"This adds the type to the module dictionary. This allows us to "
+"create :class:`!Custom` instances by calling the :class:`!Custom` class:"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:191
@@ -659,13 +657,13 @@ msgstr ".tp_dealloc = (destructor) Custom_dealloc,"
#: ../../extending/newtypes_tutorial.rst:264
msgid ""
-"This method first clears the reference counts of the two Python attributes. :"
-"c:func:`Py_XDECREF` correctly handles the case where its argument is "
-"``NULL`` (which might happen here if ``tp_new`` failed midway). It then "
-"calls the :c:member:`~PyTypeObject.tp_free` member of the object's type "
-"(computed by ``Py_TYPE(self)``) to free the object's memory. Note that the "
-"object's type might not be :class:`!CustomType`, because the object may be "
-"an instance of a subclass."
+"This method first clears the reference counts of the two Python "
+"attributes. :c:func:`Py_XDECREF` correctly handles the case where its "
+"argument is ``NULL`` (which might happen here if ``tp_new`` failed midway). "
+"It then calls the :c:member:`~PyTypeObject.tp_free` member of the object's "
+"type (computed by ``Py_TYPE(self)``) to free the object's memory. Note that "
+"the object's type might not be :class:`!CustomType`, because the object may "
+"be an instance of a subclass."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:273
@@ -738,12 +736,13 @@ msgstr ".tp_new = Custom_new,"
#: ../../extending/newtypes_tutorial.rst:307
msgid ""
"The ``tp_new`` handler is responsible for creating (as opposed to "
-"initializing) objects of the type. It is exposed in Python as the :meth:"
-"`~object.__new__` method. It is not required to define a ``tp_new`` member, "
-"and indeed many extension types will simply reuse :c:func:"
-"`PyType_GenericNew` as done in the first version of the :class:`!Custom` "
-"type above. In this case, we use the ``tp_new`` handler to initialize the "
-"``first`` and ``last`` attributes to non-``NULL`` default values."
+"initializing) objects of the type. It is exposed in Python as "
+"the :meth:`~object.__new__` method. It is not required to define a "
+"``tp_new`` member, and indeed many extension types will simply "
+"reuse :c:func:`PyType_GenericNew` as done in the first version of "
+"the :class:`!Custom` type above. In this case, we use the ``tp_new`` "
+"handler to initialize the ``first`` and ``last`` attributes to non-``NULL`` "
+"default values."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:315
@@ -752,8 +751,8 @@ msgid ""
"``CustomType``, if a subclass is instantiated) and any arguments passed when "
"the type was called, and is expected to return the instance created. "
"``tp_new`` handlers always accept positional and keyword arguments, but they "
-"often ignore the arguments, leaving the argument handling to initializer (a."
-"k.a. ``tp_init`` in C or ``__init__`` in Python) methods."
+"often ignore the arguments, leaving the argument handling to initializer "
+"(a.k.a. ``tp_init`` in C or ``__init__`` in Python) methods."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:323
@@ -774,8 +773,9 @@ msgstr "self = (CustomObject *) type->tp_alloc(type, 0);"
#: ../../extending/newtypes_tutorial.rst:331
msgid ""
-"Since memory allocation may fail, we must check the :c:member:`~PyTypeObject."
-"tp_alloc` result against ``NULL`` before proceeding."
+"Since memory allocation may fail, we must check "
+"the :c:member:`~PyTypeObject.tp_alloc` result against ``NULL`` before "
+"proceeding."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:335
@@ -789,14 +789,15 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:341
msgid ""
"If you are creating a co-operative :c:member:`~PyTypeObject.tp_new` (one "
-"that calls a base type's :c:member:`~PyTypeObject.tp_new` or :meth:`~object."
-"__new__`), you must *not* try to determine what method to call using method "
-"resolution order at runtime. Always statically determine what type you are "
-"going to call, and call its :c:member:`~PyTypeObject.tp_new` directly, or "
-"via ``type->tp_base->tp_new``. If you do not do this, Python subclasses of "
-"your type that also inherit from other Python-defined classes may not work "
-"correctly. (Specifically, you may not be able to create instances of such "
-"subclasses without getting a :exc:`TypeError`.)"
+"that calls a base type's :c:member:`~PyTypeObject.tp_new` "
+"or :meth:`~object.__new__`), you must *not* try to determine what method to "
+"call using method resolution order at runtime. Always statically determine "
+"what type you are going to call, and call "
+"its :c:member:`~PyTypeObject.tp_new` directly, or via ``type->tp_base-"
+">tp_new``. If you do not do this, Python subclasses of your type that also "
+"inherit from other Python-defined classes may not work correctly. "
+"(Specifically, you may not be able to create instances of such subclasses "
+"without getting a :exc:`TypeError`.)"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:351
@@ -869,10 +870,10 @@ msgstr ".tp_init = (initproc) Custom_init,"
#: ../../extending/newtypes_tutorial.rst:384
msgid ""
-"The :c:member:`~PyTypeObject.tp_init` slot is exposed in Python as the :meth:"
-"`~object.__init__` method. It is used to initialize an object after it's "
-"created. Initializers always accept positional and keyword arguments, and "
-"they should return either ``0`` on success or ``-1`` on error."
+"The :c:member:`~PyTypeObject.tp_init` slot is exposed in Python as "
+"the :meth:`~object.__init__` method. It is used to initialize an object "
+"after it's created. Initializers always accept positional and keyword "
+"arguments, and they should return either ``0`` on success or ``-1`` on error."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:389
@@ -923,15 +924,15 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:416
msgid ""
-"when we know that deallocation of the object [#]_ will neither release the :"
-"term:`GIL` nor cause any calls back into our type's code;"
+"when we know that deallocation of the object [#]_ will neither release "
+"the :term:`GIL` nor cause any calls back into our type's code;"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:419
msgid ""
-"when decrementing a reference count in a :c:member:`~PyTypeObject."
-"tp_dealloc` handler on a type which doesn't support cyclic garbage "
-"collection [#]_."
+"when decrementing a reference count in "
+"a :c:member:`~PyTypeObject.tp_dealloc` handler on a type which doesn't "
+"support cyclic garbage collection [#]_."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:422
@@ -1018,12 +1019,12 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:467
msgid ""
-"The method is implemented as a C function that takes a :class:`!Custom` (or :"
-"class:`!Custom` subclass) instance as the first argument. Methods always "
-"take an instance as the first argument. Methods often take positional and "
-"keyword arguments as well, but in this case we don't take any and don't need "
-"to accept a positional argument tuple or keyword argument dictionary. This "
-"method is equivalent to the Python method:"
+"The method is implemented as a C function that takes a :class:`!Custom` "
+"(or :class:`!Custom` subclass) instance as the first argument. Methods "
+"always take an instance as the first argument. Methods often take positional "
+"and keyword arguments as well, but in this case we don't take any and don't "
+"need to accept a positional argument tuple or keyword argument dictionary. "
+"This method is equivalent to the Python method:"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:474
@@ -1036,11 +1037,11 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:479
msgid ""
-"Note that we have to check for the possibility that our :attr:`!first` and :"
-"attr:`!last` members are ``NULL``. This is because they can be deleted, in "
-"which case they are set to ``NULL``. It would be better to prevent deletion "
-"of these attributes and to restrict the attribute values to be strings. "
-"We'll see how to do that in the next section."
+"Note that we have to check for the possibility that our :attr:`!first` "
+"and :attr:`!last` members are ``NULL``. This is because they can be "
+"deleted, in which case they are set to ``NULL``. It would be better to "
+"prevent deletion of these attributes and to restrict the attribute values to "
+"be strings. We'll see how to do that in the next section."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:485
@@ -1122,9 +1123,9 @@ msgstr ""
msgid ""
"In this section, we'll provide finer control over how the :attr:`!first` "
"and :attr:`!last` attributes are set in the :class:`!Custom` example. In the "
-"previous version of our module, the instance variables :attr:`!first` and :"
-"attr:`!last` could be set to non-string values or even deleted. We want to "
-"make sure that these attributes always contain strings."
+"previous version of our module, the instance variables :attr:`!first` "
+"and :attr:`!last` could be set to non-string values or even deleted. We want "
+"to make sure that these attributes always contain strings."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:538
@@ -1489,9 +1490,10 @@ msgstr ""
msgid ""
"In the second version of the :class:`!Custom` example, we allowed any kind "
"of object to be stored in the :attr:`!first` or :attr:`!last` attributes "
-"[#]_. Besides, in the second and third versions, we allowed subclassing :"
-"class:`!Custom`, and subclasses may add arbitrary attributes. For any of "
-"those two reasons, :class:`!Custom` objects can participate in cycles:"
+"[#]_. Besides, in the second and third versions, we allowed "
+"subclassing :class:`!Custom`, and subclasses may add arbitrary attributes. "
+"For any of those two reasons, :class:`!Custom` objects can participate in "
+"cycles:"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:673
@@ -1757,11 +1759,11 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:708
msgid ""
-"For each subobject that can participate in cycles, we need to call the :c:"
-"func:`!visit` function, which is passed to the traversal method. The :c:func:"
-"`!visit` function takes as arguments the subobject and the extra argument "
-"*arg* passed to the traversal method. It returns an integer value that must "
-"be returned if it is non-zero."
+"For each subobject that can participate in cycles, we need to call "
+"the :c:func:`!visit` function, which is passed to the traversal method. "
+"The :c:func:`!visit` function takes as arguments the subobject and the extra "
+"argument *arg* passed to the traversal method. It returns an integer value "
+"that must be returned if it is non-zero."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:714
@@ -1847,9 +1849,9 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:756
msgid ""
-"Nevertheless, it is much easier and less error-prone to always use :c:func:"
-"`Py_CLEAR` when deleting an attribute. Don't try to micro-optimize at the "
-"expense of robustness!"
+"Nevertheless, it is much easier and less error-prone to always "
+"use :c:func:`Py_CLEAR` when deleting an attribute. Don't try to micro-"
+"optimize at the expense of robustness!"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:760
@@ -1858,8 +1860,8 @@ msgid ""
"attributes. It means the circular GC can be triggered inside the function. "
"Since the GC assumes reference count is not zero, we need to untrack the "
"object from the GC by calling :c:func:`PyObject_GC_UnTrack` before clearing "
-"members. Here is our reimplemented deallocator using :c:func:"
-"`PyObject_GC_UnTrack` and ``Custom_clear``::"
+"members. Here is our reimplemented deallocator "
+"using :c:func:`PyObject_GC_UnTrack` and ``Custom_clear``::"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:767
@@ -1893,9 +1895,10 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:779
msgid ""
-"That's pretty much it. If we had written custom :c:member:`~PyTypeObject."
-"tp_alloc` or :c:member:`~PyTypeObject.tp_free` handlers, we'd need to modify "
-"them for cyclic garbage collection. Most extensions will use the versions "
+"That's pretty much it. If we had written "
+"custom :c:member:`~PyTypeObject.tp_alloc` "
+"or :c:member:`~PyTypeObject.tp_free` handlers, we'd need to modify them for "
+"cyclic garbage collection. Most extensions will use the versions "
"automatically provided."
msgstr ""
@@ -2074,8 +2077,9 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:839
msgid ""
-"This pattern is important when writing a type with custom :c:member:"
-"`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_dealloc` members. "
+"This pattern is important when writing a type with "
+"custom :c:member:`~PyTypeObject.tp_new` "
+"and :c:member:`~PyTypeObject.tp_dealloc` members. "
"The :c:member:`~PyTypeObject.tp_new` handler should not actually create the "
"memory for the object with its :c:member:`~PyTypeObject.tp_alloc`, but let "
"the base class handle it by calling its own :c:member:`~PyTypeObject.tp_new`."
@@ -2083,15 +2087,14 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:845
msgid ""
-"The :c:type:`PyTypeObject` struct supports a :c:member:`~PyTypeObject."
-"tp_base` specifying the type's concrete base class. Due to cross-platform "
-"compiler issues, you can't fill that field directly with a reference to :c:"
-"type:`PyList_Type`; it should be done later in the module initialization "
-"function::"
+"The :c:type:`PyTypeObject` struct supports "
+"a :c:member:`~PyTypeObject.tp_base` specifying the type's concrete base "
+"class. Due to cross-platform compiler issues, you can't fill that field "
+"directly with a reference to :c:type:`PyList_Type`; it should be done later "
+"in the module initialization function::"
msgstr ""
#: ../../extending/newtypes_tutorial.rst:851
-#, fuzzy
msgid ""
"PyMODINIT_FUNC\n"
"PyInit_sublist(void)\n"
@@ -2126,10 +2129,8 @@ msgstr ""
" if (m == NULL)\n"
" return NULL;\n"
"\n"
-" Py_INCREF(&SubListType);\n"
-" if (PyModule_AddObject(m, \"SubList\", (PyObject *) &SubListType) < 0) "
-"{\n"
-" Py_DECREF(&SubListType);\n"
+" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < "
+"0) {\n"
" Py_DECREF(m);\n"
" return NULL;\n"
" }\n"
@@ -2139,11 +2140,11 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:871
msgid ""
-"Before calling :c:func:`PyType_Ready`, the type structure must have the :c:"
-"member:`~PyTypeObject.tp_base` slot filled in. When we are deriving an "
-"existing type, it is not necessary to fill out the :c:member:`~PyTypeObject."
-"tp_alloc` slot with :c:func:`PyType_GenericNew` -- the allocation function "
-"from the base type will be inherited."
+"Before calling :c:func:`PyType_Ready`, the type structure must have "
+"the :c:member:`~PyTypeObject.tp_base` slot filled in. When we are deriving "
+"an existing type, it is not necessary to fill out "
+"the :c:member:`~PyTypeObject.tp_alloc` slot with :c:func:`PyType_GenericNew` "
+"-- the allocation function from the base type will be inherited."
msgstr ""
#: ../../extending/newtypes_tutorial.rst:877
@@ -2154,7 +2155,7 @@ msgstr ""
#: ../../extending/newtypes_tutorial.rst:882
msgid "Footnotes"
-msgstr "註解"
+msgstr "註腳"
#: ../../extending/newtypes_tutorial.rst:883
msgid ""
diff --git a/faq/design.po b/faq/design.po
index 8474f7dc97..91ee765253 100644
--- a/faq/design.po
+++ b/faq/design.po
@@ -138,17 +138,18 @@ msgstr ""
#: ../../faq/design.rst:65
msgid ""
-"The :class:`float` type in CPython uses a C ``double`` for storage. A :"
-"class:`float` object's value is stored in binary floating-point with a fixed "
-"precision (typically 53 bits) and Python uses C operations, which in turn "
-"rely on the hardware implementation in the processor, to perform floating-"
-"point operations. This means that as far as floating-point operations are "
-"concerned, Python behaves like many popular languages including C and Java."
-msgstr ""
-"CPython 的 :class:`float` 型別使用了 C 的 ``double`` 型別來儲存。一個 :class:"
-"`float` 物件的值會以固定的精度(通常為 53 位元)存為二進制浮點數,Python 使"
-"用 C 來運算浮點數,而他的結果會依處理器中的硬體實作方式來決定。這表示就浮點數"
-"運算來說,Python 和 C、Java 等很多受歡迎的語言有一樣的行為。"
+"The :class:`float` type in CPython uses a C ``double`` for storage. "
+"A :class:`float` object's value is stored in binary floating-point with a "
+"fixed precision (typically 53 bits) and Python uses C operations, which in "
+"turn rely on the hardware implementation in the processor, to perform "
+"floating-point operations. This means that as far as floating-point "
+"operations are concerned, Python behaves like many popular languages "
+"including C and Java."
+msgstr ""
+"CPython 的 :class:`float` 型別使用了 C 的 ``double`` 型別來儲存。一"
+"個 :class:`float` 物件的值會以固定的精度(通常為 53 位元)存為二進制浮點數,"
+"Python 使用 C 來運算浮點數,而他的結果會依處理器中的硬體實作方式來決定。這表"
+"示就浮點數運算來說,Python 和 C、Java 等很多受歡迎的語言有一樣的行為。"
#: ../../faq/design.rst:72
msgid ""
@@ -249,11 +250,11 @@ msgid ""
"``m_`` prefix, so this explicitness is still useful in those languages, too."
msgstr ""
"第一,這樣可以更明顯表現出你在用方法 (method) 或是實例 (instance) 的屬性,而"
-"非一個區域變數。即使不知道類別 (class) 的定義,當看到 ``self.x`` 或 ``self."
-"meth()``,就會很清楚地知道是正在使用實例的變數或是方法。在 C++ 裡,你可以藉由"
-"沒有區域變數宣告來判斷這件事 ── 但在 Python 裡沒有區域變數宣告,所以你必須去"
-"看類別的定義來確定。有些 C++ 和 Java 的程式碼規格要求要在實例屬性的名稱加上前"
-"綴 ``m_``,所以這種明確性在那些語言也是很好用的。"
+"非一個區域變數。即使不知道類別 (class) 的定義,當看到 ``self.x`` 或 "
+"``self.meth()``,就會很清楚地知道是正在使用實例的變數或是方法。在 C++ 裡,你"
+"可以藉由沒有區域變數宣告來判斷這件事 ── 但在 Python 裡沒有區域變數宣告,所以"
+"你必須去看類別的定義來確定。有些 C++ 和 Java 的程式碼規格要求要在實例屬性的名"
+"稱加上前綴 ``m_``,所以這種明確性在那些語言也是很好用的。"
#: ../../faq/design.rst:127
msgid ""
@@ -353,12 +354,12 @@ msgstr ""
msgid ""
"(b) When I read code that says len(x) I *know* that it is asking for the "
"length of something. This tells me two things: the result is an integer, and "
-"the argument is some kind of container. To the contrary, when I read x."
-"len(), I have to already know that x is some kind of container implementing "
-"an interface or inheriting from a class that has a standard len(). Witness "
-"the confusion we occasionally have when a class that is not implementing a "
-"mapping has a get() or keys() method, or something that isn't a file has a "
-"write() method."
+"the argument is some kind of container. To the contrary, when I read "
+"x.len(), I have to already know that x is some kind of container "
+"implementing an interface or inheriting from a class that has a standard "
+"len(). Witness the confusion we occasionally have when a class that is not "
+"implementing a mapping has a get() or keys() method, or something that isn't "
+"a file has a write() method."
msgstr ""
"(二) 當我看到一段程式碼寫著 len(x),我\\ *知道*\\ 他要找某個東西的長度。這"
"告訴了我兩件事:結果是一個整數、參數是某種容器。相對地,當我看到 x.len(),我"
@@ -419,8 +420,9 @@ msgstr ""
msgid ""
"The second objection is typically cast as: \"I am really telling a sequence "
"to join its members together with a string constant\". Sadly, you aren't. "
-"For some reason there seems to be much less difficulty with having :meth:"
-"`~str.split` as a string method, since in that case it is easy to see that ::"
+"For some reason there seems to be much less difficulty with "
+"having :meth:`~str.split` as a string method, since in that case it is easy "
+"to see that ::"
msgstr ""
"第二個反對意見通常是:「我是在叫一個序列把它的成員用一個字串常數連接起來」。"
"但很遺憾地,你並不是在這樣做。因為某種原因,把 :meth:`~str.split` 當成字串方"
@@ -544,8 +546,8 @@ msgstr ""
#: ../../faq/design.rst:279
msgid ""
-"For calling methods on objects, you can simplify yet further by using the :"
-"func:`getattr` built-in to retrieve methods with a particular name::"
+"For calling methods on objects, you can simplify yet further by using "
+"the :func:`getattr` built-in to retrieve methods with a particular name::"
msgstr ""
"對於呼叫物件裡的方法,你可以利用內建用來找尋特定方法的函式 :func:`getattr` 來"
"做進一步的簡化: ::"
@@ -818,10 +820,10 @@ msgstr ""
msgid ""
"Lists, on the other hand, are more like arrays in other languages. They "
"tend to hold a varying number of objects all of which have the same type and "
-"which are operated on one-by-one. For example, :func:`os.listdir('.') ` returns a list of strings representing the files in the current "
-"directory. Functions which operate on this output would generally not break "
-"if you added another file or two to the directory."
+"which are operated on one-by-one. For example, :func:`os.listdir('.') "
+"` returns a list of strings representing the files in the "
+"current directory. Functions which operate on this output would generally "
+"not break if you added another file or two to the directory."
msgstr ""
"另一方面,串列更像是其他語言的陣列 (array)。他可以有不固定個同類別物件,且為"
"逐項操作。舉例來說,:func:`os.listdir('.') ` 回傳當下目錄裡的檔"
@@ -960,8 +962,8 @@ msgstr ""
msgid ""
"would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` "
"used in the second line differs from that in the first line. In other "
-"words, dictionary keys should be compared using ``==``, not using :keyword:"
-"`is`."
+"words, dictionary keys should be compared using ``==``, not "
+"using :keyword:`is`."
msgstr ""
"這將會導致 :exc:`KeyError` 例外,因為 ``[1, 2]`` 的 id 在第一行和第二行是不同"
"的。換句話說,字典的鍵應該要用 ``==`` 來做比較,而不是用 :keyword:`is`。"
@@ -1011,9 +1013,7 @@ msgstr ""
"如果你需要的話,這裡有個小技巧可以幫你,但請自己承擔風險:你可以把一個可變物"
"件包裝進一個有 :meth:`~object.__eq__` 和 :meth:`~object.__hash__` 方法的類別"
"實例。只要這種包裝物件還存在於字典(或其他類似結構)中,你就必須確定在字典"
-"(或其他用雜湊為基底的結構)中他們的雜湊值會保持恆定。\n"
-"\n"
-"::"
+"(或其他用雜湊為基底的結構)中他們的雜湊值會保持恆定。 ::"
#: ../../faq/design.rst:513
msgid ""
@@ -1062,16 +1062,16 @@ msgstr ""
#: ../../faq/design.rst:534
msgid ""
-"Furthermore it must always be the case that if ``o1 == o2`` (ie ``o1."
-"__eq__(o2) is True``) then ``hash(o1) == hash(o2)`` (ie, ``o1.__hash__() == "
-"o2.__hash__()``), regardless of whether the object is in a dictionary or "
-"not. If you fail to meet these restrictions dictionaries and other hash "
-"based structures will misbehave."
+"Furthermore it must always be the case that if ``o1 == o2`` (ie "
+"``o1.__eq__(o2) is True``) then ``hash(o1) == hash(o2)`` (ie, "
+"``o1.__hash__() == o2.__hash__()``), regardless of whether the object is in "
+"a dictionary or not. If you fail to meet these restrictions dictionaries "
+"and other hash based structures will misbehave."
msgstr ""
"此外,不管物件是否在字典中,如果 ``o1 == o2``\\ (即 ``o1.__eq__(o2) is "
-"True``),則 ``hash(o1) == hash(o2)``\\ (即 ``o1.__hash__() == o2."
-"__hash__()``),這個事實必須要成立。如果無法滿足這項限制,那字典和其他用雜湊"
-"為基底的結構會出現不正常的行為。"
+"True``),則 ``hash(o1) == hash(o2)``\\ (即 ``o1.__hash__() == "
+"o2.__hash__()``),這個事實必須要成立。如果無法滿足這項限制,那字典和其他用雜"
+"湊為基底的結構會出現不正常的行為。"
#: ../../faq/design.rst:539
msgid ""
@@ -1136,16 +1136,17 @@ msgstr ""
msgid ""
"Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base "
"Classes (ABCs). You can then use :func:`isinstance` and :func:`issubclass` "
-"to check whether an instance or a class implements a particular ABC. The :"
-"mod:`collections.abc` module defines a set of useful ABCs such as :class:"
-"`~collections.abc.Iterable`, :class:`~collections.abc.Container`, and :class:"
-"`~collections.abc.MutableMapping`."
+"to check whether an instance or a class implements a particular ABC. "
+"The :mod:`collections.abc` module defines a set of useful ABCs such "
+"as :class:`~collections.abc.Iterable`, :class:`~collections.abc.Container`, "
+"and :class:`~collections.abc.MutableMapping`."
msgstr ""
"Python 2.6 加入了 :mod:`abc` 模組,讓你可以定義抽象基底類別 (Abstract Base "
"Class, ABC)。你可以使用 :func:`isinstance` 和 :func:`issubclass` 來確認一個實"
"例或是類別是否實作了某個抽象基底類別。而 :mod:`collections.abc` 模組定義了一"
-"系列好用的抽象基底類別,像是 :class:`~collections.abc.Iterable`、:class:"
-"`~collections.abc.Container` 和 :class:`~collections.abc.MutableMapping`。"
+"系列好用的抽象基底類別,像"
+"是 :class:`~collections.abc.Iterable`、:class:`~collections.abc.Container` "
+"和 :class:`~collections.abc.MutableMapping`。"
#: ../../faq/design.rst:578
msgid ""
@@ -1159,12 +1160,12 @@ msgid ""
"as a module interface specification and a set of examples. Many Python "
"modules can be run as a script to provide a simple \"self test.\" Even "
"modules which use complex external interfaces can often be tested in "
-"isolation using trivial \"stub\" emulations of the external interface. The :"
-"mod:`doctest` and :mod:`unittest` modules or third-party test frameworks can "
-"be used to construct exhaustive test suites that exercise every line of code "
-"in a module."
+"isolation using trivial \"stub\" emulations of the external interface. "
+"The :mod:`doctest` and :mod:`unittest` modules or third-party test "
+"frameworks can be used to construct exhaustive test suites that exercise "
+"every line of code in a module."
msgstr ""
-"一個針對模組的好測試套件提供了回歸測試 (regression testing),並作為模組介面規"
+"一個針對模組的好測試套件提供了迴歸測試 (regression testing),並作為模組介面規"
"範和一組範例。許多 Python 模組可以直接當成腳本執行,並提供簡單的「自我測"
"試」。即便模組使用了複雜的外部介面,他依然可以用外部介面的簡單的「樁」(stub) "
"模擬來獨立測試。:mod:`doctest` 和 :mod:`unittest` 模組或第三方的測試框架可以"
@@ -1209,16 +1210,16 @@ msgid ""
"\"spaghetti\" code that was hard to understand and revise. In a high-level "
"language, it is also unneeded as long as there are ways to branch (in "
"Python, with :keyword:`if` statements and :keyword:`or`, :keyword:`and`, "
-"and :keyword:`if`/:keyword:`else` expressions) and loop (with :keyword:"
-"`while` and :keyword:`for` statements, possibly containing :keyword:"
-"`continue` and :keyword:`break`)."
+"and :keyword:`if`/:keyword:`else` expressions) and loop "
+"(with :keyword:`while` and :keyword:`for` statements, possibly "
+"containing :keyword:`continue` and :keyword:`break`)."
msgstr ""
"在 1970 年代,人們了解到沒有限制的 goto 會導致混亂、難以理解和修改的「義大利"
"麵」程式碼 (\"spaghetti\" code)。在高階語言裡,這也是不需要的,因為有方法可以"
-"做邏輯分支(以 Python 來說,用 :keyword:`if` 陳述式和 :keyword:`or`、:"
-"keyword:`and` 及 :keyword:`if`/:keyword:`else` 運算式)和迴圈(用 :keyword:"
-"`while` 和 :keyword:`for` 陳述式,可能會有 :keyword:`continue` 和 :keyword:"
-"`break`)。"
+"做邏輯分支(以 Python 來說,用 :keyword:`if` 陳述式"
+"和 :keyword:`or`、:keyword:`and` 及 :keyword:`if`/:keyword:`else` 運算式)和"
+"迴圈(用 :keyword:`while` 和 :keyword:`for` 陳述式,可能會"
+"有 :keyword:`continue` 和 :keyword:`break`)。"
#: ../../faq/design.rst:614
msgid ""
@@ -1437,14 +1438,14 @@ msgstr "為何產生器 (generator) 不支援 with 陳述式?"
msgid ""
"For technical reasons, a generator used directly as a context manager would "
"not work correctly. When, as is most common, a generator is used as an "
-"iterator run to completion, no closing is needed. When it is, wrap it as :"
-"func:`contextlib.closing(generator) ` in the :keyword:"
-"`with` statement."
+"iterator run to completion, no closing is needed. When it is, wrap it "
+"as :func:`contextlib.closing(generator) ` in "
+"the :keyword:`with` statement."
msgstr ""
"出於技術原因,把產生器直接用作情境 (context) 管理器會無法正常運作。因為通常來"
"說,產生器是被當成疊代器 (iterator),到最後完成時不需要被手動關閉。但如果你需"
-"要的話,你可以在 :keyword:`with` 陳述式裡用 :func:`contextlib."
-"closing(generator) ` 來包裝他。"
+"要的話,你可以在 :keyword:`with` 陳述式裡"
+"用 :func:`contextlib.closing(generator) ` 來包裝他。"
#: ../../faq/design.rst:730
msgid "Why are colons required for the if/while/def/class statements?"
diff --git a/faq/extending.po b/faq/extending.po
index 720d5e9fe3..9e82c59186 100644
--- a/faq/extending.po
+++ b/faq/extending.po
@@ -34,11 +34,11 @@ msgstr "我可以在 C 中建立自己的函式嗎?"
#: ../../faq/extending.rst:18
msgid ""
"Yes, you can create built-in modules containing functions, variables, "
-"exceptions and even new types in C. This is explained in the document :ref:"
-"`extending-index`."
+"exceptions and even new types in C. This is explained in the "
+"document :ref:`extending-index`."
msgstr ""
-"是的,你可以在 C 中建立包含函式、變數、例外甚至新型別的內建模組,:ref:"
-"`extending-index` 文件中有相關說明。"
+"是的,你可以在 C 中建立包含函式、變數、例外甚至新型別的內建模"
+"組,:ref:`extending-index` 文件中有相關說明。"
#: ../../faq/extending.rst:22
msgid "Most intermediate or advanced Python books will also cover this topic."
@@ -73,16 +73,16 @@ msgstr "要編寫你自己的 C 擴充有許多替代方法,取決於你要執
#: ../../faq/extending.rst:44
#, fuzzy
msgid ""
-"`Cython `_ and its relative `Pyrex `_ are compilers that accept a "
-"slightly modified form of Python and generate the corresponding C code. "
-"Cython and Pyrex make it possible to write an extension without having to "
-"learn Python's C API."
+"`Cython `_ and its relative `Pyrex `_ are compilers that "
+"accept a slightly modified form of Python and generate the corresponding C "
+"code. Cython and Pyrex make it possible to write an extension without "
+"having to learn Python's C API."
msgstr ""
-"`Cython `_ 及其相關的 `Pyrex `_ 是接受稍微修改 Python 形式並生成"
-"相應的 C 程式碼。 Cython 和 Pyrex 使編寫擴充程式成為可能,而無需學習 Python "
-"的 C API。"
+"`Cython `_ 及其相關的 `Pyrex `_ 是接受稍微修改 Python "
+"形式並生成相應的 C 程式碼。 Cython 和 Pyrex 使編寫擴充程式成為可能,而無需學"
+"習 Python 的 C API。"
#: ../../faq/extending.rst:50
#, fuzzy
@@ -95,7 +95,7 @@ msgid ""
"`_ are also alternatives for wrapping C++ "
"libraries."
msgstr ""
-"如果你需要連接到當前不存在 Python 擴充的某些 C 或 C++ 函式庫,你可以嘗試使用 "
+"如果你需要連接到目前不存在 Python 擴充的某些 C 或 C++ 函式庫,你可以嘗試使用 "
"`SWIG `_ 等工具包裝函式庫的資料型別和函式。`SIP "
"`__、`CXX `_ `Boost `_ 或 `Weave "
@@ -111,15 +111,15 @@ msgid ""
"The highest-level function to do this is :c:func:`PyRun_SimpleString` which "
"takes a single string argument to be executed in the context of the module "
"``__main__`` and returns ``0`` for success and ``-1`` when an exception "
-"occurred (including :exc:`SyntaxError`). If you want more control, use :c:"
-"func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in "
-"``Python/pythonrun.c``."
+"occurred (including :exc:`SyntaxError`). If you want more control, "
+"use :c:func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` "
+"in ``Python/pythonrun.c``."
msgstr ""
"執行此操作的最高級別函式是 :c:func:`PyRun_SimpleString`,它採用單個字串引數在"
"模組 ``__main__`` 的上下文中執行,並回傳 ``0`` 表示成功,``- 1`` 發生例外時"
-"(包括 :exc:`SyntaxError`)。如果你想要更多的控制,使用 :c:func:"
-"`PyRun_String`;在 ``Python/pythonrun.c`` 中查看 :c:func:"
-"`PyRun_SimpleString` 的原始碼。"
+"(包括 :exc:`SyntaxError`)。如果你想要更多的控制,使"
+"用 :c:func:`PyRun_String`;在 ``Python/pythonrun.c`` 中查"
+"看 :c:func:`PyRun_SimpleString` 的原始碼。"
#: ../../faq/extending.rst:72
#, fuzzy
@@ -133,8 +133,8 @@ msgid ""
"start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it "
"and returns its value."
msgstr ""
-"呼叫上一個問題中的函式 :c:func:`PyRun_String` 開始符號 :c:data:"
-"`Py_eval_input`;它解析一個運算式,對其求值並回傳它的值。"
+"呼叫上一個問題中的函式 :c:func:`PyRun_String` 開始符"
+"號 :c:data:`Py_eval_input`;它解析一個運算式,對其求值並回傳它的值。"
#: ../../faq/extending.rst:80
msgid "How do I extract C values from a Python object?"
@@ -145,33 +145,34 @@ msgstr "如何從 Python 物件中提取 C 值?"
msgid ""
"That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size` "
"returns its length and :c:func:`PyTuple_GetItem` returns the item at a "
-"specified index. Lists have similar functions, :c:func:`PyList_Size` and :c:"
-"func:`PyList_GetItem`."
+"specified index. Lists have similar functions, :c:func:`PyList_Size` "
+"and :c:func:`PyList_GetItem`."
msgstr ""
-"這取決於物件的型別。如果它是一個元組,:c:func:`PyTuple_Size` 回傳它的長度,:"
-"c:func:`PyTuple_GetItem` 回傳指定索引的項目。列表具有類似的函式:c:func:"
-"`PyList_Size` 和 :c:func:`PyList_GetItem`。"
+"這取決於物件的型別。如果它是一個元組,:c:func:`PyTuple_Size` 回傳它的長"
+"度,:c:func:`PyTuple_GetItem` 回傳指定索引的項目。列表具有類似的函式:"
+"c:func:`PyList_Size` 和 :c:func:`PyList_GetItem`。"
#: ../../faq/extending.rst:87
#, fuzzy
msgid ""
-"For bytes, :c:func:`PyBytes_Size` returns its length and :c:func:"
-"`PyBytes_AsStringAndSize` provides a pointer to its value and its length. "
-"Note that Python bytes objects may contain null bytes so C's :c:func:`!"
-"strlen` should not be used."
+"For bytes, :c:func:`PyBytes_Size` returns its length "
+"and :c:func:`PyBytes_AsStringAndSize` provides a pointer to its value and "
+"its length. Note that Python bytes objects may contain null bytes so "
+"C's :c:func:`!strlen` should not be used."
msgstr ""
-"對於位元組,:c:func:`PyBytes_Size` 回傳它的長度,:c:func:"
-"`PyBytes_AsStringAndSize` 提供指向它的值和長度的指標。請注意,Python 位元組物"
-"件可能包含空位元組,因此不應使用 C 的 :c:func:`!strlen`。"
+"對於位元組,:c:func:`PyBytes_Size` 回傳它的長"
+"度,:c:func:`PyBytes_AsStringAndSize` 提供指向它的值和長度的指標。請注意,"
+"Python 位元組物件可能包含空位元組,因此不應使用 C 的 :c:func:`!strlen`。"
#: ../../faq/extending.rst:92
msgid ""
"To test the type of an object, first make sure it isn't ``NULL``, and then "
-"use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:"
-"`PyList_Check`, etc."
+"use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:`PyList_Check`, "
+"etc."
msgstr ""
-"要測試物件的型別,首先確保它不是 ``NULL``,然後再使用 :c:func:"
-"`PyBytes_Check`、:c:func:`PyTuple_Check`、:c:func:`PyList_Check` 等函式。"
+"要測試物件的型別,首先確保它不是 ``NULL``,然後再使"
+"用 :c:func:`PyBytes_Check`、:c:func:`PyTuple_Check`、:c:func:`PyList_Check` "
+"等函式。"
#: ../../faq/extending.rst:95
#, fuzzy
@@ -184,9 +185,10 @@ msgid ""
"al.) and mappings in the PyMapping APIs."
msgstr ""
"還有一個針對 Python 物件的高級 API,它由所謂的「抽象」介面提供——閱讀 "
-"``Include/abstract.h`` 了解更多詳細資訊。它允許使用 :c:func:"
-"`PySequence_Length`、:c:func:`PySequence_GetItem` 等呼叫以及許多其他有用的協"
-"議(例如數字 (:c:func:`PyNumber_Index) ` 等)和 PyMapping API 中的對映。"
+"``Include/abstract.h`` 了解更多詳細資訊。它允許使"
+"用 :c:func:`PySequence_Length`、:c:func:`PySequence_GetItem` 等呼叫以及許多其"
+"他有用的協議(例如數字 (:c:func:`PyNumber_Index) ` 等)和 PyMapping API 中的"
+"對映。"
#: ../../faq/extending.rst:104
msgid "How do I use Py_BuildValue() to create a tuple of arbitrary length?"
@@ -229,8 +231,8 @@ msgid ""
"defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the "
"return value."
msgstr ""
-"這適用於任何具有方法的物件——無論是內建的還是使用者定義的。你負責最終 :c:func:"
-"`Py_DECREF`\\ 'ing 回傳值。"
+"這適用於任何具有方法的物件——無論是內建的還是使用者定義的。你負責最"
+"終 :c:func:`Py_DECREF`\\ 'ing 回傳值。"
#: ../../faq/extending.rst:124
msgid ""
@@ -277,9 +279,9 @@ msgid ""
"print_error, or just allow the standard traceback mechanism to work. Then, "
"the output will go wherever your ``write()`` method sends it."
msgstr ""
-"在 Python 程式碼中,定義一個支援 ``write()`` 方法的物件。將此物件分配給 :"
-"data:`sys.stdout` 和 :data:`sys.stderr`。呼叫 print_error,或者只允許標準的回"
-"溯機制起作用。然後,輸出將到達你的 ``write()`` 方法發送它的任何地方。"
+"在 Python 程式碼中,定義一個支援 ``write()`` 方法的物件。將此物件分配"
+"給 :data:`sys.stdout` 和 :data:`sys.stderr`。呼叫 print_error,或者只允許標準"
+"的回溯機制起作用。然後,輸出將到達你的 ``write()`` 方法發送它的任何地方。"
#: ../../faq/extending.rst:149
msgid "The easiest way to do this is to use the :class:`io.StringIO` class:"
@@ -356,11 +358,11 @@ msgstr "module = PyImport_ImportModule(\"\");"
#: ../../faq/extending.rst:188
#, fuzzy
msgid ""
-"If the module hasn't been imported yet (i.e. it is not yet present in :data:"
-"`sys.modules`), this initializes the module; otherwise it simply returns the "
-"value of ``sys.modules[\"\"]``. Note that it doesn't enter the "
-"module into any namespace -- it only ensures it has been initialized and is "
-"stored in :data:`sys.modules`."
+"If the module hasn't been imported yet (i.e. it is not yet present "
+"in :data:`sys.modules`), this initializes the module; otherwise it simply "
+"returns the value of ``sys.modules[\"\"]``. Note that it "
+"doesn't enter the module into any namespace -- it only ensures it has been "
+"initialized and is stored in :data:`sys.modules`."
msgstr ""
"如果模組還沒有被引入(即它還沒有出現在 :data:`sys.modules` 中),這會初始化模"
"組;否則它只回傳 ``sys.modules[\"\"]`` 的值。請注意,它不會將模組"
@@ -516,9 +518,9 @@ msgid ""
"``Parser/myreadline.c`` for more hints."
msgstr ""
"在 C 中執行此操作的最簡單方法是呼叫:c:func:`PyRun_InteractiveLoop`(可能在單"
-"獨的執行緒中)並讓 Python 直譯器為你處理輸入。你還可以將 :c:func:"
-"`PyOS_ReadlineFunctionPointer` 設定為指向你的自定義輸入函式。有關更多提示,請"
-"參閱``Modules/readline.c`` 和``Parser/myreadline.c``。"
+"獨的執行緒中)並讓 Python 直譯器為你處理輸入。你還可以"
+"將 :c:func:`PyOS_ReadlineFunctionPointer` 設定為指向你的自定義輸入函式。有關"
+"更多提示,請參閱``Modules/readline.c`` 和``Parser/myreadline.c``。"
#: ../../faq/extending.rst:275
msgid "How do I find undefined g++ symbols __builtin_new or __pure_virtual?"
@@ -541,22 +543,22 @@ msgid ""
"Can I create an object class with some methods implemented in C and others "
"in Python (e.g. through inheritance)?"
msgstr ""
-"我可以用一些用 C 實作的方法和用 Python 實作的其他方法(例如通過繼承)建立一個"
+"我可以用一些用 C 實作的方法和用 Python 實作的其他方法(例如透過繼承)建立一個"
"物件類別嗎?"
#: ../../faq/extending.rst:285
msgid ""
-"Yes, you can inherit from built-in classes such as :class:`int`, :class:"
-"`list`, :class:`dict`, etc."
+"Yes, you can inherit from built-in classes such "
+"as :class:`int`, :class:`list`, :class:`dict`, etc."
msgstr ""
"是的,你可以繼承內建類別,例如 :class:`int`、:class:`list`、:class:`dict` "
"等。"
#: ../../faq/extending.rst:288
msgid ""
-"The Boost Python Library (BPL, https://www.boost.org/libs/python/doc/index."
-"html) provides a way of doing this from C++ (i.e. you can inherit from an "
-"extension class written in C++ using the BPL)."
+"The Boost Python Library (BPL, https://www.boost.org/libs/python/doc/"
+"index.html) provides a way of doing this from C++ (i.e. you can inherit from "
+"an extension class written in C++ using the BPL)."
msgstr ""
"Boost Python 函式庫(BPL,https://www.boost.org/libs/python/doc/index.html)"
"提供了一種從 C++ 執行此操作的方法(即你可以使用 BPL 來繼承用 C++ 編寫的擴充類"
diff --git a/faq/general.po b/faq/general.po
index ac24b2276b..ac684d513b 100644
--- a/faq/general.po
+++ b/faq/general.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-24 07:20+0000\n"
+"POT-Creation-Date: 2025-02-19 00:13+0000\n"
"PO-Revision-Date: 2023-06-23 16:56+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -84,14 +84,14 @@ msgid ""
msgstr ""
"Python 軟體基金會 (Python Software Foundation) 是一個獨立的非營利性組織,它擁"
"有 Python 2.1 版與之後各版本的版權。PSF 的使命在於推展 Python 程式設計語言相"
-"關的開放原始碼技術,以及宣傳 Python 的使用。PSF 首頁的網址是 https://www."
-"python.org/psf/。"
+"關的開放原始碼技術,以及宣傳 Python 的使用。PSF 首頁的網址是 https://"
+"www.python.org/psf/。"
#: ../../faq/general.rst:42
msgid ""
"Donations to the PSF are tax-exempt in the US. If you use Python and find "
-"it helpful, please contribute via `the PSF donation page `_."
+"it helpful, please contribute via `the PSF donation page `_."
msgstr ""
"在美國捐款給 PSF 是免稅的。如果你使用了 Python 且發現它很有用,請至 `PSF 捐款"
"頁面 `_\\ 為它做出貢獻。"
@@ -333,6 +333,11 @@ msgid ""
"See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, "
"and :data:`sys.version_info`."
msgstr ""
+"請參閱\\ `開發人員指南 `__\\ 以獲得更多關於開發週期的資訊,並參閱 :pep:`387` 以瞭"
+"解更多關於 Python 的向後相容性政策。另外,也請查"
+"看 :data:`sys.version`、:data:`sys.hexversion` 和 :data:`sys.version_info` 的"
+"說明文件。"
#: ../../faq/general.rst:169
msgid "How do I obtain a copy of the Python source?"
@@ -344,9 +349,9 @@ msgid ""
"at https://www.python.org/downloads/. The latest development sources can be "
"obtained at https://github.com/python/cpython/."
msgstr ""
-"最新的 Python 原始碼發行版永遠可以從 python.org 取得,在 https://www.python."
-"org/downloads/。最新的開發中原始碼可以在 https://github.com/python/cpython/ "
-"取得。"
+"最新的 Python 原始碼發行版永遠可以從 python.org 取得,在 https://"
+"www.python.org/downloads/。最新的開發中原始碼可以在 https://github.com/"
+"python/cpython/ 取得。"
#: ../../faq/general.rst:175
msgid ""
@@ -421,9 +426,10 @@ msgid ""
"There is a newsgroup, :newsgroup:`comp.lang.python`, and a mailing list, "
"`python-list `_. The "
"newsgroup and mailing list are gatewayed into each other -- if you can read "
-"news it's unnecessary to subscribe to the mailing list. :newsgroup:`comp."
-"lang.python` is high-traffic, receiving hundreds of postings every day, and "
-"Usenet readers are often more able to cope with this volume."
+"news it's unnecessary to subscribe to the mailing "
+"list. :newsgroup:`comp.lang.python` is high-traffic, receiving hundreds of "
+"postings every day, and Usenet readers are often more able to cope with this "
+"volume."
msgstr ""
"有一個新聞群組 (newsgroup),:newsgroup:`comp.lang.python`,也有一個郵件討論"
"群 (mailing list),`python-list `_."
msgstr ""
"新的軟體發布版本及事件的通知,可以在 comp.lang.python.announce 中找到,這是一"
@@ -458,9 +464,9 @@ msgstr "如何取得 Python 的 beta 測試版本?"
#: ../../faq/general.rst:229
msgid ""
"Alpha and beta releases are available from https://www.python.org/"
-"downloads/. All releases are announced on the comp.lang.python and comp."
-"lang.python.announce newsgroups and on the Python home page at https://www."
-"python.org/; an RSS feed of news is available."
+"downloads/. All releases are announced on the comp.lang.python and "
+"comp.lang.python.announce newsgroups and on the Python home page at https://"
+"www.python.org/; an RSS feed of news is available."
msgstr ""
"Alpha 和 beta 發布版本可以從 https://www.python.org/downloads/ 取得。所有的發"
"布版本都會在 comp.lang.python 和 comp.lang.python.announce 新聞群組上宣布,也"
@@ -480,8 +486,8 @@ msgstr "如何提交 Python 的錯誤報告和修補程式?"
#: ../../faq/general.rst:241
msgid ""
-"To report a bug or submit a patch, use the issue tracker at https://github."
-"com/python/cpython/issues."
+"To report a bug or submit a patch, use the issue tracker at https://"
+"github.com/python/cpython/issues."
msgstr ""
"要回報一個錯誤 (bug) 或提交一個修補程式 (patch),請使用於 https://github.com/"
"python/cpython/issues 的問題追蹤系統。"
@@ -547,8 +553,8 @@ msgstr "www.python.org 的真實位置在哪裡?"
#: ../../faq/general.rst:274
msgid ""
"The Python project's infrastructure is located all over the world and is "
-"managed by the Python Infrastructure Team. Details `here `__."
+"managed by the Python Infrastructure Team. Details `here `__."
msgstr ""
"Python 專案的基礎建設遍佈世界各地,由 Python 基礎建設團隊管理。詳細資訊\\ `在"
"此 `__。"
@@ -560,8 +566,8 @@ msgstr "為什麼要取名為 Python?"
#: ../../faq/general.rst:281
msgid ""
"When he began implementing Python, Guido van Rossum was also reading the "
-"published scripts from `\"Monty Python's Flying Circus\" `__, a BBC comedy series from the 1970s. "
+"published scripts from `\"Monty Python's Flying Circus\" `__, a BBC comedy series from the 1970s. "
"Van Rossum thought he needed a name that was short, unique, and slightly "
"mysterious, so he decided to call the language Python."
msgstr ""
@@ -611,7 +617,6 @@ msgstr ""
"且會保證介面在一系列的錯誤修正發布版本中維持不變。"
#: ../../faq/general.rst:311
-#, fuzzy
msgid ""
"The latest stable releases can always be found on the `Python download page "
"`_. Python 3.x is the recommended version "
@@ -619,9 +624,8 @@ msgid ""
"maintained anymore <373>`."
msgstr ""
"最新的穩定發布版本隨時都可以在 `Python 下載頁面 `_\\ 上找到。Python 有兩個生產就緒 (production-ready) 的版本:2.x "
-"和 3.x。推薦的版本是 3.x,此版本能被那些最為廣泛使用的函式庫所支援。雖然 2.x "
-"仍然被廣泛使用,但\\ :pep:`它已不再被維護 <0373>`。"
+"downloads/>`_\\ 上找到。Python 3.x 是推薦的版本,並且被大多數廣泛使用的函式庫"
+"所支援。Python 2.x :pep:`已不再被維護 <0373>`。"
#: ../../faq/general.rst:318
msgid "How many people are using Python?"
@@ -657,8 +661,8 @@ msgstr "有沒有任何重要的專案使用 Python 完成開發?"
#: ../../faq/general.rst:334
msgid ""
"See https://www.python.org/about/success for a list of projects that use "
-"Python. Consulting the proceedings for `past Python conferences `_ will reveal contributions from many "
+"Python. Consulting the proceedings for `past Python conferences `_ will reveal contributions from many "
"different companies and organizations."
msgstr ""
"要查看使用 Python 的專案清單,請參閱 https://www.python.org/about/success。藉"
@@ -668,17 +672,17 @@ msgstr ""
#: ../../faq/general.rst:339
msgid ""
"High-profile Python projects include `the Mailman mailing list manager "
-"`_ and `the Zope application server `_. Several Linux distributions, most notably `Red Hat `_, have written part or all of their installer and system "
-"administration software in Python. Companies that use Python internally "
-"include Google, Yahoo, and Lucasfilm Ltd."
-msgstr ""
-"備受矚目的 Python 專案包括 `Mailman 郵件討論群管理員 `_\\ 和 `Zope 應用程式伺服器 `_。有一些 Linux 發行"
-"版,最著名的是 `Red Hat `_,已經用 Python 編寫了部分"
-"或全部的安裝程式及系統管理軟體。內部使用 Python 的公司包括 Google、Yahoo 和 "
-"Lucasfilm Ltd。"
+"`_ and `the Zope application server `_. Several Linux distributions, most notably `Red Hat "
+"`_, have written part or all of their installer and "
+"system administration software in Python. Companies that use Python "
+"internally include Google, Yahoo, and Lucasfilm Ltd."
+msgstr ""
+"備受矚目的 Python 專案包括 `Mailman 郵件討論群管理員 `_\\ 和 `Zope 應用程式伺服器 `_。有一些 "
+"Linux 發行版,最著名的是 `Red Hat `_,已經用 Python "
+"編寫了部分或全部的安裝程式及系統管理軟體。內部使用 Python 的公司包括 Google、"
+"Yahoo 和 Lucasfilm Ltd。"
#: ../../faq/general.rst:348
msgid "What new developments are expected for Python in the future?"
@@ -699,8 +703,8 @@ msgstr ""
#: ../../faq/general.rst:356
msgid ""
-"New development is discussed on `the python-dev mailing list `_."
+"New development is discussed on `the python-dev mailing list `_."
msgstr ""
"新的開發會在 `python-dev 郵件討論群 `_\\ 中討論。"
@@ -810,7 +814,7 @@ msgstr ""
#: ../../faq/general.rst:412
msgid ""
">>> L = []\n"
-">>> dir(L) \n"
+">>> dir(L)\n"
"['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',\n"
"'__dir__', '__doc__', '__eq__', '__format__', '__ge__',\n"
"'__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__',\n"
@@ -835,7 +839,7 @@ msgid ""
"[1]"
msgstr ""
">>> L = []\n"
-">>> dir(L) \n"
+">>> dir(L)\n"
"['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',\n"
"'__dir__', '__doc__', '__eq__', '__format__', '__ge__',\n"
"'__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__',\n"
@@ -889,13 +893,3 @@ msgid ""
msgstr ""
"如果你想討論 Python 在教育領域中的使用,你可能會有興趣加入 `edu-sig 郵件討論"
"群 `_。"
-
-#~ msgid "See :pep:`6` for more information about bugfix releases."
-#~ msgstr "更多關於錯誤修正發布的資訊請見 :pep:`6`。"
-
-#~ msgid ""
-#~ "See also the documentation for :data:`sys.version`, :data:`sys."
-#~ "hexversion`, and :data:`sys.version_info`."
-#~ msgstr ""
-#~ "另請參閱 :data:`sys.version`、:data:`sys.hexversion` 和 :data:`sys."
-#~ "version_info` 的說明文件。"
diff --git a/faq/library.po b/faq/library.po
index 648029c94e..21409fd6a7 100644
--- a/faq/library.po
+++ b/faq/library.po
@@ -49,13 +49,13 @@ msgstr ""
#: ../../faq/library.rst:21
#, fuzzy
msgid ""
-"For third-party packages, search the `Python Package Index `_ or try `Google `_ or another web search "
+"For third-party packages, search the `Python Package Index `_ or try `Google `_ or another web search "
"engine. Searching for \"Python\" plus a keyword or two for your topic of "
"interest will usually find something helpful."
msgstr ""
-"對於第三方包,搜索`Python 包索引`_ 或嘗試`Google `_ 或其他網路搜索引擎。搜索 \"Python\" 加上你感興趣的主題的一"
+"對於第三方包,搜尋`Python 包索引`_ 或嘗試`Google `_ 或其他網路搜尋引擎。搜尋 \"Python\" 加上你感興趣的主題的一"
"兩個關鍵字通常會找到有用的東西。"
#: ../../faq/library.rst:28
@@ -67,13 +67,13 @@ msgstr "哪裡可以找到 math.py (socket.py, regex.py, 等...) 來源檔案?
msgid ""
"If you can't find a source file for a module it may be a built-in or "
"dynamically loaded module implemented in C, C++ or other compiled language. "
-"In this case you may not have the source file or it may be something like :"
-"file:`mathmodule.c`, somewhere in a C source directory (not on the Python "
-"Path)."
+"In this case you may not have the source file or it may be something "
+"like :file:`mathmodule.c`, somewhere in a C source directory (not on the "
+"Python Path)."
msgstr ""
"如果找不到模組的源檔案,它可能是用 C、C++ 或其他編譯語言實作的內置或動態載入"
-"的模組。在這種情況下,你可能沒有源檔案,或者它可能類似於 :file:`mathmodule."
-"c`,位於 C 源目錄中(不在 Python 路徑中)。"
+"的模組。在這種情況下,你可能沒有源檔案,或者它可能類似"
+"於 :file:`mathmodule.c`,位於 C 源目錄中(不在 Python 路徑中)。"
#: ../../faq/library.rst:35
msgid "There are (at least) three kinds of modules in Python:"
@@ -99,6 +99,8 @@ msgid ""
"import sys\n"
"print(sys.builtin_module_names)"
msgstr ""
+"import sys\n"
+"print(sys.builtin_module_names)"
#: ../../faq/library.rst:47
msgid "How do I make a Python script executable on Unix?"
@@ -115,20 +117,18 @@ msgstr ""
"Python 直譯器的路徑。"
#: ../../faq/library.rst:53
-#, fuzzy
msgid ""
"The first is done by executing ``chmod +x scriptfile`` or perhaps ``chmod "
"755 scriptfile``."
msgstr ""
-"第一個是通過執行 ``chmod +x scriptfile`` 或者 ``chmod 755 scriptfile`` 來完成"
-"的。"
+"第一個是透過執行 ``chmod +x scriptfile`` 或者可能是 ``chmod 755 scriptfile`` "
+"來完成的。"
#: ../../faq/library.rst:56
-#, fuzzy
msgid ""
"The second can be done in a number of ways. The most straightforward way is "
"to write ::"
-msgstr "第二個可以通過多種方式完成。最直接的方法是寫: ::"
+msgstr "第二個則可以透過多種方式完成。最直接的方法是寫: ::"
#: ../../faq/library.rst:59
msgid "#!/usr/local/bin/python"
@@ -150,22 +150,21 @@ msgid ""
"directory on the user's :envvar:`PATH`::"
msgstr ""
"如果你希望腳本獨立於 Python 直譯器所在的位置,你可以使用 :program:`env` 程"
-"式。幾乎所有 Unix 變體都支援以下內容,假設 Python 直譯器位於使用者的 :envvar:"
-"`PATH` 上的目錄中: ::"
+"式。幾乎所有 Unix 變體都支援以下內容,假設 Python 直譯器位於使用者"
+"的 :envvar:`PATH` 上的目錄中: ::"
#: ../../faq/library.rst:69
msgid "#!/usr/bin/env python"
msgstr "#!/usr/bin/env python"
#: ../../faq/library.rst:71
-#, fuzzy
msgid ""
"*Don't* do this for CGI scripts. The :envvar:`PATH` variable for CGI "
"scripts is often very minimal, so you need to use the actual absolute "
"pathname of the interpreter."
msgstr ""
-"*不要*對 CGI 腳本執行此操作。 CGI 腳本的 :envvar:`PATH` 變數通常非常小,因此"
-"你需要使用直譯器的實際絕對路徑名。"
+"*不要*\\ 對 CGI 腳本執行此操作。CGI 腳本的 :envvar:`PATH` 變數通常非常小,因"
+"此你需要使用直譯器的實際絕對路徑名稱。"
#: ../../faq/library.rst:75
#, fuzzy
@@ -190,17 +189,16 @@ msgstr ""
"\"\"\""
#: ../../faq/library.rst:86
-#, fuzzy
msgid ""
"The minor disadvantage is that this defines the script's __doc__ string. "
"However, you can fix that by adding ::"
msgstr ""
-"次要缺點是這定義了腳本的 __doc__ 字串。但是,你可以通過新增來解決這個問"
-"題: ::"
+"次要缺點是這定義了腳本的 __doc__ 字串。但是你可以透過新增下面這一行來解決這個"
+"問題: ::"
#: ../../faq/library.rst:89
msgid "__doc__ = \"\"\"...Whatever...\"\"\""
-msgstr ""
+msgstr "__doc__ = \"\"\"...Whatever...\"\"\""
#: ../../faq/library.rst:94
msgid "Is there a curses/termcap package for Python?"
@@ -230,7 +228,7 @@ msgid ""
msgstr ""
":mod:`curses` 模組支援基本的 curses 功能以及 ncurses 和 SYSV curses 的許多附"
"加功能,例如顏色、替代字元集支援、鍵盤和鼠標支援。這意味著該模組與僅具有 BSD "
-"curses 的作業系統不相容,但似乎沒有任何當前維護的作業系統屬於此類型。"
+"curses 的作業系統不相容,但似乎沒有任何目前維護的作業系統屬於此類型。"
#: ../../faq/library.rst:111
msgid "Is there an equivalent to C's onexit() in Python?"
@@ -241,19 +239,18 @@ msgstr "Python 中是否有等同於 C 的 onexit() 的函式?"
msgid ""
"The :mod:`atexit` module provides a register function that is similar to "
"C's :c:func:`!onexit`."
-msgstr ""
-":mod:`atexit` 模組提供了一個類似於 C 的 :c:func:`onexit` 的寄存器函式。"
+msgstr ":mod:`atexit` 模組提供了一個類似於 C :c:func:`onexit` 的註冊器函式。"
#: ../../faq/library.rst:118
msgid "Why don't my signal handlers work?"
-msgstr "為什麼我的信號處理程式不起作用?"
+msgstr "為什麼我的訊號處理程式不起作用?"
#: ../../faq/library.rst:120
#, fuzzy
msgid ""
"The most common problem is that the signal handler is declared with the "
"wrong argument list. It is called as ::"
-msgstr "最常見的問題是信號處理程式是用錯誤的引數列表聲明的。它被稱為: ::"
+msgstr "最常見的問題是訊號處理程式是用錯誤的引數列表聲明的。它被稱為: ::"
#: ../../faq/library.rst:123
msgid "handler(signum, frame)"
@@ -286,8 +283,8 @@ msgid ""
"examples in the docstrings for a module and runs them, comparing the output "
"with the expected output given in the docstring."
msgstr ""
-"Python 帶有兩個測試框架。 :mod:`doctest` 模組在模組的文檔字串中查詢示例並運行"
-"它們,將輸出與文檔字串中給出的預期輸出進行比較。"
+"Python 帶有兩個測試框架。 :mod:`doctest` 模組在模組的文件字串中查詢示例並運行"
+"它們,將輸出與文件字串中給出的預期輸出進行比較。"
#: ../../faq/library.rst:141
#, fuzzy
@@ -311,19 +308,21 @@ msgid ""
msgstr ""
"為了使測試更容易,你應該在程式中使用良好的模組化設計。你的程式應該將幾乎所有"
"功能都封裝在函式或類別方法中——這有時會產生使程式運行得更快的令人驚訝和令人愉"
-"快的效果(因為局部變數存取比全局存取更快)。此外,該程式應避免依賴於可變的全"
+"快的效果(因為局部變數存取比全域存取更快)。此外,該程式應避免依賴於可變的全"
"局變數,因為這會使測試變得更加困難。"
#: ../../faq/library.rst:152
#, fuzzy
msgid "The \"global main logic\" of your program may be as simple as ::"
-msgstr "你程式的「全局主邏輯」可能像一樣簡單: ::"
+msgstr "你程式的「全域主邏輯」可能像一樣簡單: ::"
#: ../../faq/library.rst:154
msgid ""
"if __name__ == \"__main__\":\n"
" main_logic()"
msgstr ""
+"if __name__ == \"__main__\":\n"
+" main_logic()"
#: ../../faq/library.rst:157
#, fuzzy
@@ -344,7 +343,7 @@ msgid ""
msgstr ""
"一旦你的程式被組織為函式和類別行為的易於處理的集合,你就應該編寫測試函式來執"
"行這些行為。可將一系列測試自動化的測試套件與每個模組相關聯。這聽起來像是很多"
-"工作,但由於 Python 如此簡潔和靈活,所以它非常容易。通過與 \"生產程式碼\" 並"
+"工作,但由於 Python 如此簡潔和靈活,所以它非常容易。透過與 \"生產程式碼\" 並"
"行編寫測試函式,你可以使編碼變得更加愉快和有趣,因為這使得更早地發現錯誤甚至"
"設計缺陷變得容易。"
@@ -360,6 +359,8 @@ msgid ""
"if __name__ == \"__main__\":\n"
" self_test()"
msgstr ""
+"if __name__ == \"__main__\":\n"
+" self_test()"
#: ../../faq/library.rst:173
#, fuzzy
@@ -368,13 +369,12 @@ msgid ""
"when the external interfaces are unavailable by using \"fake\" interfaces "
"implemented in Python."
msgstr ""
-"即使是與復雜外部介面交互的程式也可以在外部介面不可用時通過使用 Python 中實作"
+"即使是與復雜外部介面交互的程式也可以在外部介面不可用時透過使用 Python 中實作"
"的 \"假\" 介面進行測試。"
#: ../../faq/library.rst:179
-#, fuzzy
msgid "How do I create documentation from doc strings?"
-msgstr "如何從文檔字串建立文檔?"
+msgstr "如何從文件字串建立文件?"
#: ../../faq/library.rst:181
#, fuzzy
@@ -384,9 +384,9 @@ msgid ""
"docstrings is `epydoc `_. `Sphinx `_ can also include docstring content."
msgstr ""
-":mod:`pydoc` 模組可以從 Python 源程式碼中的文檔字串建立 HTML。純粹從文檔字串"
-"建立 API 文檔的另一種方法是 `epydoc `_。 "
-"`Sphinx `_ 也可以包含文檔字串內容。"
+":mod:`pydoc` 模組可以從 Python 源程式碼中的文件字串建立 HTML。純粹從文件字串"
+"建立 API 文件的另一種方法是 `epydoc `_。 "
+"`Sphinx `_ 也可以包含文件字串內容。"
#: ../../faq/library.rst:188
#, fuzzy
@@ -417,8 +417,9 @@ msgid ""
"module. The :mod:`threading` module builds convenient abstractions on top of "
"the low-level primitives provided by the :mod:`_thread` module."
msgstr ""
-"請務必使用 :mod:`threading` 模組而不是 :mod:`_thread` 模組。 :mod:"
-"`threading` 模組在 :mod:`_thread` 模組提供的低階原語之上構建方便的抽象。"
+"請務必使用 :mod:`threading` 模組而不是 :mod:`_thread` 模"
+"組。 :mod:`threading` 模組在 :mod:`_thread` 模組提供的低階原語之上構建方便的"
+"抽象。"
#: ../../faq/library.rst:245
msgid "None of my threads seem to run: why?"
@@ -455,6 +456,17 @@ msgid ""
"\n"
"time.sleep(10) # <---------------------------!"
msgstr ""
+"import threading, time\n"
+"\n"
+"def thread_task(name, n):\n"
+" for i in range(n):\n"
+" print(name, i)\n"
+"\n"
+"for i in range(10):\n"
+" T = threading.Thread(target=thread_task, args=(str(i), i))\n"
+" T.start()\n"
+"\n"
+"time.sleep(10) # <---------------------------!"
#: ../../faq/library.rst:265
#, fuzzy
@@ -485,17 +497,27 @@ msgid ""
"\n"
"time.sleep(10)"
msgstr ""
+"def thread_task(name, n):\n"
+" time.sleep(0.001) # <--------------------!\n"
+" for i in range(n):\n"
+" print(name, i)\n"
+"\n"
+"for i in range(10):\n"
+" T = threading.Thread(target=thread_task, args=(str(i), i))\n"
+" T.start()\n"
+"\n"
+"time.sleep(10)"
#: ../../faq/library.rst:282
#, fuzzy
msgid ""
"Instead of trying to guess a good delay value for :func:`time.sleep`, it's "
-"better to use some kind of semaphore mechanism. One idea is to use the :mod:"
-"`queue` module to create a queue object, let each thread append a token to "
-"the queue when it finishes, and let the main thread read as many tokens from "
-"the queue as there are threads."
+"better to use some kind of semaphore mechanism. One idea is to use "
+"the :mod:`queue` module to create a queue object, let each thread append a "
+"token to the queue when it finishes, and let the main thread read as many "
+"tokens from the queue as there are threads."
msgstr ""
-"與其嘗試為 :func:`time.sleep` 猜測一個好的延遲值,不如使用某種信號量機制。一"
+"與其嘗試為 :func:`time.sleep` 猜測一個好的延遲值,不如使用某種訊號量機制。一"
"種想法是使用 :mod:`queue` 模組建立一個隊列物件,讓每個執行緒在完成時向隊列新"
"增一個權杖,並讓主執行緒從隊列中讀取與執行緒數一樣多的權杖。"
@@ -510,8 +532,8 @@ msgid ""
"The easiest way is to use the :mod:`concurrent.futures` module, especially "
"the :mod:`~concurrent.futures.ThreadPoolExecutor` class."
msgstr ""
-"最簡單的方法是使用 :mod:`concurrent.futures` 模組,尤其是 :mod:`~concurrent."
-"futures.ThreadPoolExecutor` 類別。"
+"最簡單的方法是使用 :mod:`concurrent.futures` 模組,尤其"
+"是 :mod:`~concurrent.futures.ThreadPoolExecutor` 類別。"
#: ../../faq/library.rst:295
#, fuzzy
@@ -523,13 +545,12 @@ msgid ""
"``.get()`` method to return them. The class will take care of the locking "
"necessary to ensure that each job is handed out exactly once."
msgstr ""
-"或者,如果你想對調度演算法進行精細控制,你可以手動編寫自己的邏輯。使用 :mod:"
-"`queue` 模組建立一個包含作業列表的隊列。 :class:`~queue.Queue` 類別維護一個物"
-"件列表,並有一個 `.put(obj)`` 方法將項目新增到隊列和一個 ``.get()`` 方法回傳"
-"它們。該類別將負責必要的鎖定,以確保每個作業都恰好分發一次。"
+"或者,如果你想對調度演算法進行精細控制,你可以手動編寫自己的邏輯。使"
+"用 :mod:`queue` 模組建立一個包含作業列表的隊列。 :class:`~queue.Queue` 類別維"
+"護一個物件列表,並有一個 `.put(obj)`` 方法將項目新增到隊列和一個 ``.get()`` "
+"方法回傳它們。該類別將負責必要的鎖定,以確保每個作業都恰好分發一次。"
#: ../../faq/library.rst:302
-#, fuzzy
msgid "Here's a trivial example::"
msgstr "這是一個簡單的例子: ::"
@@ -573,7 +594,6 @@ msgid ""
msgstr ""
#: ../../faq/library.rst:340
-#, fuzzy
msgid "When run, this will produce the following output:"
msgstr "運行時,這將產生以下輸出:"
@@ -610,16 +630,16 @@ msgstr ""
#: ../../faq/library.rst:358
#, fuzzy
msgid ""
-"Consult the module's documentation for more details; the :class:`~queue."
-"Queue` class provides a featureful interface."
+"Consult the module's documentation for more details; "
+"the :class:`~queue.Queue` class provides a featureful interface."
msgstr ""
-"有關更多詳細資訊,請參閱模組的文檔; :class:`~queue.Queue` 類別提供了一個功能"
+"有關更多詳細資訊,請參閱模組的文件; :class:`~queue.Queue` 類別提供了一個功能"
"強大的介面。"
#: ../../faq/library.rst:363
#, fuzzy
msgid "What kinds of global value mutation are thread-safe?"
-msgstr "什麼樣的全局值突變是執行緒安全的?"
+msgstr "什麼樣的全域值突變是執行緒安全的?"
#: ../../faq/library.rst:365
#, fuzzy
@@ -631,9 +651,9 @@ msgid ""
"instruction and therefore all the C implementation code reached from each "
"instruction is therefore atomic from the point of view of a Python program."
msgstr ""
-"內部使用 :term:`全局直譯器鎖 (GIL, global interpreter lock)`\\ 來確保一次只有"
+"內部使用 :term:`全域直譯器鎖 (GIL, global interpreter lock)`\\ 來確保一次只有"
"一個執行緒在 Python VM 中運行。通常,Python 僅提供位元組碼指令之間的執行緒切"
-"換;可以通過 :func:`sys.setswitchinterval` 設定它切換的頻率。因此,從 Python "
+"換;可以透過 :func:`sys.setswitchinterval` 設定它切換的頻率。因此,從 Python "
"程式的角度來看,每條位元組碼指令以及從每條指令到達的所有 C 實作程式碼都是原子"
"的。"
@@ -703,18 +723,18 @@ msgstr ""
#: ../../faq/library.rst:399
#, fuzzy
msgid ""
-"Operations that replace other objects may invoke those other objects' :meth:"
-"`~object.__del__` method when their reference count reaches zero, and that "
-"can affect things. This is especially true for the mass updates to "
-"dictionaries and lists. When in doubt, use a mutex!"
+"Operations that replace other objects may invoke those other "
+"objects' :meth:`~object.__del__` method when their reference count reaches "
+"zero, and that can affect things. This is especially true for the mass "
+"updates to dictionaries and lists. When in doubt, use a mutex!"
msgstr ""
-"替換其他物件的操作可能會在引用計數達到零時呼叫其他物件的 :meth:`__del__` 方"
+"替換其他物件的操作可能會在引用計數達到零時叫用其他物件的 :meth:`__del__` 方"
"法,這可能會影響事情。對於字典和列表的大量更新尤其如此。如有疑問,請使用互斥"
"體!"
#: ../../faq/library.rst:406
msgid "Can't we get rid of the Global Interpreter Lock?"
-msgstr "不能擺脫全局直譯器鎖嗎?"
+msgstr "不能擺脫全域直譯器鎖嗎?"
#: ../../faq/library.rst:408
#, fuzzy
@@ -773,10 +793,10 @@ msgid ""
"case you want more control over dispatching of tasks."
msgstr ""
"這並不意味著你不能在多 CPU 機器上用好 Python!你只需要創造性地將工作分配給多"
-"個*行程*而不是多個*執行緒*。新的 :mod:`concurrent.futures` 模組中的 :class:"
-"`~concurrent.futures.ProcessPoolExecutor` 類別提供了一種簡單的方法; :mod:"
-"`multiprocessing` 模組提供了一個較低階別的 API,以防你希望更好地控制任務的調"
-"度。"
+"個*行程*而不是多個*執行緒*。新的 :mod:`concurrent.futures` 模組中"
+"的 :class:`~concurrent.futures.ProcessPoolExecutor` 類別提供了一種簡單的方"
+"法; :mod:`multiprocessing` 模組提供了一個較低階別的 API,以防你希望更好地控"
+"制任務的調度。"
#: ../../faq/library.rst:446
#, fuzzy
@@ -784,8 +804,8 @@ msgid ""
"Judicious use of C extensions will also help; if you use a C extension to "
"perform a time-consuming task, the extension can release the GIL while the "
"thread of execution is in the C code and allow other threads to get some "
-"work done. Some standard library modules such as :mod:`zlib` and :mod:"
-"`hashlib` already do this."
+"work done. Some standard library modules such as :mod:`zlib` "
+"and :mod:`hashlib` already do this."
msgstr ""
"明智地使用 C 擴充也會有所幫助;如果你使用 C 擴充來執行耗時任務,則該擴充可以"
"在執行執行緒在 C 程式碼中時釋放 GIL,並允許其他執行緒完成一些工作。一些標準函"
@@ -801,6 +821,11 @@ msgid ""
"since these must be written with multiple interpreters in mind in order to "
"be usable, so many older extension modules will not be usable."
msgstr ""
+"減少 GIL 影響的另一種方法是將 GIL 設置為直譯器各自狀態的鎖 (per-interpreter-"
+"state lock),而不是真正的全域鎖。這在 :ref:`Python 3.12 中首次實現 "
+"`,並且可於 C API 中使用。預計 Python 3.13 將會提供其 "
+"Python 介面。目前主要的限制可能是第三方擴充模組,因為實作時必須考慮到多個直譯"
+"器才能使用,因此許多舊的擴充模組將無法使用。"
#: ../../faq/library.rst:462
msgid "Input and Output"
@@ -814,12 +839,13 @@ msgstr "如何刪除檔案?(以及其他檔案問題...)"
#, fuzzy
msgid ""
"Use ``os.remove(filename)`` or ``os.unlink(filename)``; for documentation, "
-"see the :mod:`os` module. The two functions are identical; :func:`~os."
-"unlink` is simply the name of the Unix system call for this function."
+"see the :mod:`os` module. The two functions are "
+"identical; :func:`~os.unlink` is simply the name of the Unix system call for "
+"this function."
msgstr ""
-"使用 ``os.remove(filename)`` 或 ``os.unlink(filename)``;有關文檔,請參閱 :"
-"mod:`os` 模組。這兩個功能是相同的; :func:`~os.unlink` 只是這個函式的 Unix 系"
-"統呼叫的名稱。"
+"使用 ``os.remove(filename)`` 或 ``os.unlink(filename)``;有關文件,請參"
+"閱 :mod:`os` 模組。這兩個功能是相同的; :func:`~os.unlink` 只是這個函式的 "
+"Unix 系統呼叫的名稱。"
#: ../../faq/library.rst:471
#, fuzzy
@@ -830,10 +856,10 @@ msgid ""
"directories as long as they're empty; if you want to delete an entire "
"directory tree and its contents, use :func:`shutil.rmtree`."
msgstr ""
-"要刪除目錄,請使用 :func:`os.rmdir`;使用 :func:`os.mkdir` 建立一個。 ``os."
-"makedirs(path)`` 將在 ``path`` 中建立任何不存在的中間目錄。 ``os."
-"removedirs(path)`` 將刪除中間目錄,只要它們是空的;如果要刪除整個目錄樹及其內"
-"容,請使用 :func:`shutil.rmtree`。"
+"要刪除目錄,請使用 :func:`os.rmdir`;使用 :func:`os.mkdir` 建立一個。 "
+"``os.makedirs(path)`` 將在 ``path`` 中建立任何不存在的中間目錄。 "
+"``os.removedirs(path)`` 將刪除中間目錄,只要它們是空的;如果要刪除整個目錄樹"
+"及其內容,請使用 :func:`shutil.rmtree`。"
#: ../../faq/library.rst:477
msgid "To rename a file, use ``os.rename(old_path, new_path)``."
@@ -844,23 +870,24 @@ msgstr "要重新命名檔案,請使用 ``os.rename(old_path, new_path)``。"
msgid ""
"To truncate a file, open it using ``f = open(filename, \"rb+\")``, and use "
"``f.truncate(offset)``; offset defaults to the current seek position. "
-"There's also ``os.ftruncate(fd, offset)`` for files opened with :func:`os."
-"open`, where *fd* is the file descriptor (a small integer)."
+"There's also ``os.ftruncate(fd, offset)`` for files opened "
+"with :func:`os.open`, where *fd* is the file descriptor (a small integer)."
msgstr ""
-"要截斷一個檔案,使用``f = open(filename, \"rb+\")``打開它,然後使用``f."
-"truncate(offset)``;偏移量預設為當前搜索位置。對於使用 :func:`os.open` 打開的"
-"檔案,還有 ``os.ftruncate(fd, offset)``,其中 *fd* 是檔案描述器(一個小整"
+"要截斷一個檔案,使用``f = open(filename, \"rb+\")``打開它,然後使用"
+"``f.truncate(offset)``;偏移量預設為目前搜尋位置。對於使用 :func:`os.open` 打"
+"開的檔案,還有 ``os.ftruncate(fd, offset)``,其中 *fd* 是檔案描述器(一個小整"
"數)。"
#: ../../faq/library.rst:484
#, fuzzy
msgid ""
"The :mod:`shutil` module also contains a number of functions to work on "
-"files including :func:`~shutil.copyfile`, :func:`~shutil.copytree`, and :"
-"func:`~shutil.rmtree`."
+"files including :func:`~shutil.copyfile`, :func:`~shutil.copytree`, "
+"and :func:`~shutil.rmtree`."
msgstr ""
-":mod:`shutil` 模組還包含許多用於處理檔案的函式,包括:func:`~shutil."
-"copyfile`、:func:`~shutil.copytree` 和:func:`~shutil.rmtree`。"
+":mod:`shutil` 模組還包含許多用於處理檔案的函式,包"
+"括:func:`~shutil.copyfile`、:func:`~shutil.copytree` "
+"和:func:`~shutil.rmtree`。"
#: ../../faq/library.rst:490
msgid "How do I copy a file?"
@@ -879,10 +906,10 @@ msgid ""
msgstr ""
":mod:`shutil` 模組包含一個 :func:`~shutil.copyfile` 函式。請注意,在 Windows "
"NTFS 卷上,它不會複製 `alternate data streams `_ 也不會複製 `resource forks `__ 在 macOS HFS+ 卷上,儘管現在兩者都很少"
-"使用。它也不會複製檔案權限和元資料,儘管使用 :func:`shutil.copy2` 會保留其中"
-"的大部分(儘管不是全部)。"
+"NTFS#Alternate_data_stream_(ADS)>`_ 也不會複製 `resource forks