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 ed99a444c7..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.1
+ 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/about.po b/about.po
index 34c5041570..a95b16de88 100644
--- a/about.po
+++ b/about.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:
@@ -14,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2022-08-05 00:19+0000\n"
+"POT-Creation-Date: 2025-01-01 00:15+0000\n"
"PO-Revision-Date: 2022-05-12 00:11+0800\n"
"Last-Translator: hsiao yi \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -27,18 +26,19 @@ msgstr ""
"X-Generator: Poedit 3.0.1\n"
#: ../../about.rst:3
-msgid "About these documents"
-msgstr "關於這些說明文件"
+msgid "About this documentation"
+msgstr "關於這份說明文件"
#: ../../about.rst:6
msgid ""
-"These documents are generated from `reStructuredText`_ sources by `Sphinx`_, "
-"a document processor specifically written for the Python documentation."
+"Python's documentation is generated from `reStructuredText`_ sources using "
+"`Sphinx`_, a documentation generator originally created for Python and now "
+"maintained as an independent project."
msgstr ""
-"這些說明文件是透過 `Sphinx`_ (一個專為 Python 說明文件所撰寫的文件處理器)將"
-"使用 `reStructuredText`_ 撰寫的原始檔轉換而成。"
+"Python 說明文件是透過使用 `Sphinx`_\\ (一個原為 Python 而生的文件產生器、目"
+"前是以獨立專案形式來維護)將使用 `reStructuredText`_ 撰寫的原始檔轉換而成。"
-#: ../../about.rst:15
+#: ../../about.rst:16
msgid ""
"Development of the documentation and its toolchain is an entirely volunteer "
"effort, just like Python itself. If you want to contribute, please take a "
@@ -49,26 +49,26 @@ msgstr ""
"報臭蟲,請見 :ref:`reporting-bugs` 頁面,內含相關資訊。我們永遠歡迎新的自願者"
"加入!"
-#: ../../about.rst:20
+#: ../../about.rst:21
msgid "Many thanks go to:"
msgstr "致謝:"
-#: ../../about.rst:22
+#: ../../about.rst:23
msgid ""
"Fred L. Drake, Jr., the creator of the original Python documentation toolset "
-"and writer of much of the content;"
+"and author of much of the content;"
msgstr ""
"Fred L. Drake, Jr.,原始 Python 文件工具集的創造者以及一大部份內容的作者;"
-#: ../../about.rst:24
+#: ../../about.rst:25
msgid ""
"the `Docutils `_ project for creating "
"reStructuredText and the Docutils suite;"
msgstr ""
-"創造 reStructuredText 和 Docutils 工具組的 `Docutils `_ 專案;"
+"創造 reStructuredText 和 Docutils 工具組的 `Docutils `_ 專案;"
-#: ../../about.rst:26
+#: ../../about.rst:27
msgid ""
"Fredrik Lundh for his Alternative Python Reference project from which Sphinx "
"got many good ideas."
@@ -76,11 +76,11 @@ msgstr ""
"Fredrik Lundh 先生,Sphinx 從他的 Alternative Python Reference 計劃中獲得許多"
"的好主意。"
-#: ../../about.rst:31
-msgid "Contributors to the Python Documentation"
+#: ../../about.rst:32
+msgid "Contributors to the Python documentation"
msgstr "Python 文件的貢獻者們"
-#: ../../about.rst:33
+#: ../../about.rst:34
msgid ""
"Many people have contributed to the Python language, the Python standard "
"library, and the Python documentation. See :source:`Misc/ACKS` in the "
@@ -89,7 +89,7 @@ msgstr ""
"許多人都曾為 Python 這門語言、Python 標準函式庫和 Python 說明文件貢獻過。"
"Python 所發佈的原始碼中含有部份貢獻者的清單,請見 :source:`Misc/ACKS` 。"
-#: ../../about.rst:37
+#: ../../about.rst:38
msgid ""
"It is only with the input and contributions of the Python community that "
"Python has such wonderful documentation -- Thank You!"
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 6e8339452f..921b3bae7f 100644
--- a/c-api/arg.po
+++ b/c-api/arg.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:
@@ -7,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-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-"
@@ -25,7 +24,7 @@ msgstr "剖析引數與建置數值"
#: ../../c-api/arg.rst:8
msgid ""
-"These functions are useful when creating your own extensions functions and "
+"These functions are useful when creating your own extension functions and "
"methods. Additional information and examples are available in :ref:"
"`extending-index`."
msgstr ""
@@ -41,7 +40,7 @@ msgstr ""
#: ../../c-api/arg.rst:19
msgid "Parsing arguments"
-msgstr ""
+msgstr "剖析引數"
#: ../../c-api/arg.rst:21
msgid ""
@@ -152,7 +151,7 @@ msgstr ""
#: ../../c-api/arg.rst:100
msgid "``s*`` (:class:`str` or :term:`bytes-like object`) [Py_buffer]"
-msgstr "``s*``\\ (:class:`str` 或 :term:`bytes-like object`)[Py_buffer]"
+msgstr "``s*`` (:class:`str` 或 :term:`bytes-like object`) [Py_buffer]"
#: ../../c-api/arg.rst:101
msgid ""
@@ -167,6 +166,8 @@ msgid ""
"``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`]"
#: ../../c-api/arg.rst:107
msgid ""
@@ -177,9 +178,9 @@ msgid ""
"encoding."
msgstr ""
-#: ../../c-api/arg.rst:113 ../../c-api/arg.rst:581
+#: ../../c-api/arg.rst:113 ../../c-api/arg.rst:593
msgid "``z`` (:class:`str` or ``None``) [const char \\*]"
-msgstr "``z``\\ (:class:`str` 或 ``None``)[const char \\*]"
+msgstr "``z`` (:class:`str` 或 ``None``) [const char \\*]"
#: ../../c-api/arg.rst:114
msgid ""
@@ -191,7 +192,7 @@ msgstr ""
msgid ""
"``z*`` (:class:`str`, :term:`bytes-like object` or ``None``) [Py_buffer]"
msgstr ""
-"``z*``\\ (:class:`str`、:term:`bytes-like object` 或 ``None``)[Py_buffer]"
+"``z*`` (:class:`str`、:term:`bytes-like object` 或 ``None``) [Py_buffer]"
#: ../../c-api/arg.rst:118
msgid ""
@@ -204,6 +205,8 @@ msgid ""
"``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) "
"[const char \\*, :c:type:`Py_ssize_t`]"
msgstr ""
+"``z#`` (:class:`str`、唯讀的 :term:`bytes-like object` 或 ``None``) [const "
+"char \\*, :c:type:`Py_ssize_t`]"
#: ../../c-api/arg.rst:122
msgid ""
@@ -213,7 +216,7 @@ msgstr ""
#: ../../c-api/arg.rst:125
msgid "``y`` (read-only :term:`bytes-like object`) [const char \\*]"
-msgstr "``y``\\ (唯讀 :term:`bytes-like object`)[const char \\*]"
+msgstr "``y`` (唯讀的 :term:`bytes-like object`) [const char \\*]"
#: ../../c-api/arg.rst:126
msgid ""
@@ -244,6 +247,8 @@ msgid ""
"``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`]"
#: ../../c-api/arg.rst:142
msgid ""
@@ -287,7 +292,7 @@ msgstr ""
#: ../../c-api/arg.rst:160
msgid "``w*`` (read-write :term:`bytes-like object`) [Py_buffer]"
-msgstr "``w*`` (可讀寫 :term:`bytes-like object`) [Py_buffer]"
+msgstr "``w*`` (可讀寫 :term:`bytes-like object`) [Py_buffer]"
#: ../../c-api/arg.rst:161
msgid ""
@@ -331,6 +336,8 @@ msgid ""
"``et`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char "
"\\*encoding, char \\*\\*buffer]"
msgstr ""
+"``et`` (:class:`str`、:class:`bytes` 或 :class:`bytearray`) [const char "
+"\\*encoding, char \\*\\*buffer]"
#: ../../c-api/arg.rst:184
msgid ""
@@ -344,6 +351,8 @@ msgid ""
"``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]"
#: ../../c-api/arg.rst:189
msgid ""
@@ -367,7 +376,7 @@ msgstr ""
#: ../../c-api/arg.rst:203
msgid "There are two modes of operation:"
-msgstr ""
+msgstr "有兩個操作模式:"
#: ../../c-api/arg.rst:205
msgid ""
@@ -417,38 +426,59 @@ msgid "Numbers"
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."
+msgstr ""
+
+#: ../../c-api/arg.rst:238
+msgid ""
+"For signed integer formats, :exc:`OverflowError` is raised if the value is "
+"out of range for the C type. For unsigned integer formats, no range checking "
+"is done --- the most significant bits are silently truncated when the "
+"receiving field is too small to receive the value."
+msgstr ""
+
+#: ../../c-api/arg.rst:244
msgid "``b`` (:class:`int`) [unsigned char]"
msgstr "``b`` (:class:`int`) [unsigned char]"
-#: ../../c-api/arg.rst:233
+#: ../../c-api/arg.rst:245
msgid ""
-"Convert a nonnegative Python integer to an unsigned tiny int, stored in a C :"
-"c:expr:`unsigned char`."
+"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`"
-#: ../../c-api/arg.rst:236 ../../c-api/arg.rst:615
+#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:627
msgid "``B`` (:class:`int`) [unsigned char]"
msgstr "``B`` (:class:`int`) [unsigned char]"
-#: ../../c-api/arg.rst:237
+#: ../../c-api/arg.rst:249
msgid ""
-"Convert a Python integer to a tiny int without overflow checking, stored in "
-"a C :c:expr:`unsigned char`."
+"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`。"
-#: ../../c-api/arg.rst:240 ../../c-api/arg.rst:609
+#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:621
msgid "``h`` (:class:`int`) [short int]"
msgstr "``h`` (:class:`int`) [short int]"
-#: ../../c-api/arg.rst:241
+#: ../../c-api/arg.rst:253
msgid "Convert a Python integer to a C :c:expr:`short int`."
msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`short int`。"
-#: ../../c-api/arg.rst:243 ../../c-api/arg.rst:618
+#: ../../c-api/arg.rst:255 ../../c-api/arg.rst:630
msgid "``H`` (:class:`int`) [unsigned short int]"
msgstr "``H`` (:class:`int`) [unsigned short int]"
-#: ../../c-api/arg.rst:244
+#: ../../c-api/arg.rst:256
msgid ""
"Convert a Python integer to a C :c:expr:`unsigned short int`, without "
"overflow checking."
@@ -456,57 +486,57 @@ msgstr ""
"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned short int`,轉換過程無溢位檢"
"查。"
-#: ../../c-api/arg.rst:247 ../../c-api/arg.rst:603
+#: ../../c-api/arg.rst:259 ../../c-api/arg.rst:615
msgid "``i`` (:class:`int`) [int]"
msgstr "``i`` (:class:`int`) [int]"
-#: ../../c-api/arg.rst:248
+#: ../../c-api/arg.rst:260
msgid "Convert a Python integer to a plain C :c:expr:`int`."
msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`int`。"
-#: ../../c-api/arg.rst:250 ../../c-api/arg.rst:621
+#: ../../c-api/arg.rst:262 ../../c-api/arg.rst:633
msgid "``I`` (:class:`int`) [unsigned int]"
msgstr "``I`` (:class:`int`) [unsigned int]"
-#: ../../c-api/arg.rst:251
+#: ../../c-api/arg.rst:263
msgid ""
"Convert a Python integer to a C :c:expr:`unsigned int`, without overflow "
"checking."
msgstr ""
"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned int`,轉換過程無溢位檢查。"
-#: ../../c-api/arg.rst:254 ../../c-api/arg.rst:612
+#: ../../c-api/arg.rst:266 ../../c-api/arg.rst:624
msgid "``l`` (:class:`int`) [long int]"
msgstr "``l`` (:class:`int`) [long int]"
-#: ../../c-api/arg.rst:255
+#: ../../c-api/arg.rst:267
msgid "Convert a Python integer to a C :c:expr:`long int`."
msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long int`。"
-#: ../../c-api/arg.rst:257 ../../c-api/arg.rst:624
+#: ../../c-api/arg.rst:269 ../../c-api/arg.rst:636
msgid "``k`` (:class:`int`) [unsigned long]"
msgstr "``k`` (:class:`int`) [unsigned long]"
-#: ../../c-api/arg.rst:258
+#: ../../c-api/arg.rst:270
msgid ""
"Convert a Python integer to a C :c:expr:`unsigned long` without overflow "
"checking."
msgstr ""
"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long`,轉換過程無溢位檢查。"
-#: ../../c-api/arg.rst:261 ../../c-api/arg.rst:627
+#: ../../c-api/arg.rst:273 ../../c-api/arg.rst:639
msgid "``L`` (:class:`int`) [long long]"
msgstr "``L`` (:class:`int`) [long long]"
-#: ../../c-api/arg.rst:262
+#: ../../c-api/arg.rst:274
msgid "Convert a Python integer to a C :c:expr:`long long`."
msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long long`。"
-#: ../../c-api/arg.rst:264 ../../c-api/arg.rst:630
+#: ../../c-api/arg.rst:276 ../../c-api/arg.rst:644
msgid "``K`` (:class:`int`) [unsigned long long]"
msgstr "``K`` (:class:`int`) [unsigned long long]"
-#: ../../c-api/arg.rst:265
+#: ../../c-api/arg.rst:277
msgid ""
"Convert a Python integer to a C :c:expr:`unsigned long long` without "
"overflow checking."
@@ -514,71 +544,71 @@ msgstr ""
"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long long`,轉換過程無溢位檢"
"查。"
-#: ../../c-api/arg.rst:268 ../../c-api/arg.rst:633
+#: ../../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`]"
-#: ../../c-api/arg.rst:269
+#: ../../c-api/arg.rst:281
msgid "Convert a Python integer to a C :c:type:`Py_ssize_t`."
msgstr "將一個 Python 整數轉換成 C 的 :c:type:`Py_ssize_t`。"
-#: ../../c-api/arg.rst:271
+#: ../../c-api/arg.rst:283
msgid "``c`` (:class:`bytes` or :class:`bytearray` of length 1) [char]"
-msgstr "``c``\\ (:class:`bytes` 或長度為 1 的 :class:`bytearray`)[char]"
+msgstr "``c`` (:class:`bytes` 或長度為 1 的 :class:`bytearray`) [char]"
-#: ../../c-api/arg.rst:272
+#: ../../c-api/arg.rst:284
msgid ""
"Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray` "
"object of length 1, to a C :c:expr:`char`."
msgstr ""
-#: ../../c-api/arg.rst:275
+#: ../../c-api/arg.rst:287
msgid "Allow :class:`bytearray` objects."
msgstr "允許 :class:`bytearray` 物件。"
-#: ../../c-api/arg.rst:278 ../../c-api/arg.rst:640
+#: ../../c-api/arg.rst:290 ../../c-api/arg.rst:654
msgid "``C`` (:class:`str` of length 1) [int]"
-msgstr "``C``\\ (長度為 1 的 :class:`str`)[int]"
+msgstr "``C`` (長度為 1 的 :class:`str`) [int]"
-#: ../../c-api/arg.rst:279
+#: ../../c-api/arg.rst:291
msgid ""
"Convert a Python character, represented as a :class:`str` object of length "
"1, to a C :c:expr:`int`."
msgstr ""
-#: ../../c-api/arg.rst:282 ../../c-api/arg.rst:647
+#: ../../c-api/arg.rst:294 ../../c-api/arg.rst:661
msgid "``f`` (:class:`float`) [float]"
msgstr "``f`` (:class:`float`) [float]"
-#: ../../c-api/arg.rst:283
+#: ../../c-api/arg.rst:295
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:285 ../../c-api/arg.rst:644
+#: ../../c-api/arg.rst:297 ../../c-api/arg.rst:658
msgid "``d`` (:class:`float`) [double]"
msgstr "``d`` (:class:`float`) [double]"
-#: ../../c-api/arg.rst:286
+#: ../../c-api/arg.rst:298
msgid "Convert a Python floating-point number to a C :c:expr:`double`."
msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`double`。"
-#: ../../c-api/arg.rst:288
+#: ../../c-api/arg.rst:300
msgid "``D`` (:class:`complex`) [Py_complex]"
msgstr "``D`` (:class:`complex`) [Py_complex]"
-#: ../../c-api/arg.rst:289
+#: ../../c-api/arg.rst:301
msgid "Convert a Python complex number to a C :c:type:`Py_complex` structure."
msgstr "將一個 Python 複數轉換成 C 的 :c:type:`Py_complex` 結構。"
-#: ../../c-api/arg.rst:292
+#: ../../c-api/arg.rst:304
msgid "Other objects"
msgstr "其他物件"
-#: ../../c-api/arg.rst:294 ../../c-api/arg.rst:653
+#: ../../c-api/arg.rst:306 ../../c-api/arg.rst:667
msgid "``O`` (object) [PyObject \\*]"
-msgstr "``O``\\ (物件)[PyObject \\*]"
+msgstr "``O`` (object) [PyObject \\*]"
-#: ../../c-api/arg.rst:295
+#: ../../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:"
@@ -586,11 +616,11 @@ msgid ""
"not increased). The pointer stored is not ``NULL``."
msgstr ""
-#: ../../c-api/arg.rst:301
+#: ../../c-api/arg.rst:313
msgid "``O!`` (object) [*typeobject*, PyObject \\*]"
-msgstr "``O!``\\ (物件)[*typeobject*, PyObject \\*]"
+msgstr "``O!`` (object) [*typeobject*, PyObject \\*]"
-#: ../../c-api/arg.rst:302
+#: ../../c-api/arg.rst:314
msgid ""
"Store a Python object in a C object pointer. This is similar to ``O``, but "
"takes two C arguments: the first is the address of a Python type object, the "
@@ -599,11 +629,11 @@ msgid ""
"required type, :exc:`TypeError` is raised."
msgstr ""
-#: ../../c-api/arg.rst:310 ../../c-api/arg.rst:671
-msgid "``O&`` (object) [*converter*, *anything*]"
-msgstr "``O&``\\ (物件)[*converter*, *anything*]"
+#: ../../c-api/arg.rst:322
+msgid "``O&`` (object) [*converter*, *address*]"
+msgstr "``O&`` (object) [*converter*, *address*]"
-#: ../../c-api/arg.rst:311
+#: ../../c-api/arg.rst:323
msgid ""
"Convert a Python object to a C variable through a *converter* function. "
"This takes two arguments: the first is a function, the second is the address "
@@ -611,11 +641,11 @@ msgid ""
"*converter* function in turn is called as follows::"
msgstr ""
-#: ../../c-api/arg.rst:316
+#: ../../c-api/arg.rst:328
msgid "status = converter(object, address);"
msgstr "status = converter(object, address);"
-#: ../../c-api/arg.rst:318
+#: ../../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 "
@@ -625,24 +655,30 @@ msgid ""
"unmodified."
msgstr ""
-#: ../../c-api/arg.rst:324
+#: ../../c-api/arg.rst:339
msgid ""
-"If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a "
-"second time if the argument parsing eventually fails, giving the converter a "
-"chance to release any memory that it had already allocated. In this second "
-"call, the *object* parameter will be ``NULL``; *address* will have the same "
-"value as in the original call."
+"If the *converter* returns :c:macro:`!Py_CLEANUP_SUPPORTED`, it may get "
+"called a second time if the argument parsing eventually fails, giving the "
+"converter a chance to release any memory that it had already allocated. In "
+"this second call, the *object* parameter will be ``NULL``; *address* will "
+"have the same value as in the original call."
msgstr ""
-#: ../../c-api/arg.rst:330
-msgid "``Py_CLEANUP_SUPPORTED`` was added."
-msgstr "加入 ``Py_CLEANUP_SUPPORTED``。"
+#: ../../c-api/arg.rst:345
+msgid ""
+"Examples of converters: :c:func:`PyUnicode_FSConverter` and :c:func:"
+"`PyUnicode_FSDecoder`."
+msgstr ""
+
+#: ../../c-api/arg.rst:348
+msgid ":c:macro:`!Py_CLEANUP_SUPPORTED` was added."
+msgstr "新增 :c:macro:`!Py_CLEANUP_SUPPORTED`。"
-#: ../../c-api/arg.rst:333
+#: ../../c-api/arg.rst:351
msgid "``p`` (:class:`bool`) [int]"
msgstr "``p`` (:class:`bool`) [int]"
-#: ../../c-api/arg.rst:334
+#: ../../c-api/arg.rst:352
msgid ""
"Tests the value passed in for truth (a boolean **p**\\ redicate) and "
"converts the result to its equivalent C true/false integer value. Sets the "
@@ -651,37 +687,28 @@ msgid ""
"how Python tests values for truth."
msgstr ""
-#: ../../c-api/arg.rst:342 ../../c-api/arg.rst:677
+#: ../../c-api/arg.rst:360 ../../c-api/arg.rst:691
msgid "``(items)`` (:class:`tuple`) [*matching-items*]"
msgstr "``(items)`` (:class:`tuple`) [*matching-items*]"
-#: ../../c-api/arg.rst:343
+#: ../../c-api/arg.rst:361
msgid ""
"The object must be a Python sequence whose length is the number of format "
"units in *items*. The C arguments must correspond to the individual format "
"units in *items*. Format units for sequences may be nested."
msgstr ""
-#: ../../c-api/arg.rst:347
-msgid ""
-"It is possible to pass \"long\" integers (integers whose value exceeds the "
-"platform's :c:macro:`LONG_MAX`) however no proper range checking is done --- "
-"the most significant bits are silently truncated when the receiving field is "
-"too small to receive the value (actually, the semantics are inherited from "
-"downcasts in C --- your mileage may vary)."
-msgstr ""
-
-#: ../../c-api/arg.rst:353
+#: ../../c-api/arg.rst:365
msgid ""
"A few other characters have a meaning in a format string. These may not "
"occur inside nested parentheses. They are:"
msgstr ""
-#: ../../c-api/arg.rst:356
+#: ../../c-api/arg.rst:368
msgid "``|``"
msgstr "``|``"
-#: ../../c-api/arg.rst:357
+#: ../../c-api/arg.rst:369
msgid ""
"Indicates that the remaining arguments in the Python argument list are "
"optional. The C variables corresponding to optional arguments should be "
@@ -690,11 +717,11 @@ msgid ""
"corresponding C variable(s)."
msgstr ""
-#: ../../c-api/arg.rst:363
+#: ../../c-api/arg.rst:375
msgid "``$``"
msgstr "``$``"
-#: ../../c-api/arg.rst:364
+#: ../../c-api/arg.rst:376
msgid ""
":c:func:`PyArg_ParseTupleAndKeywords` only: Indicates that the remaining "
"arguments in the Python argument list are keyword-only. Currently, all "
@@ -702,36 +729,36 @@ msgid ""
"be specified before ``$`` in the format string."
msgstr ""
-#: ../../c-api/arg.rst:372
+#: ../../c-api/arg.rst:384
msgid "``:``"
msgstr "``:``"
-#: ../../c-api/arg.rst:373
+#: ../../c-api/arg.rst:385
msgid ""
"The list of format units ends here; the string after the colon is used as "
"the function name in error messages (the \"associated value\" of the "
"exception that :c:func:`PyArg_ParseTuple` raises)."
msgstr ""
-#: ../../c-api/arg.rst:377
+#: ../../c-api/arg.rst:389
msgid "``;``"
msgstr "``;``"
-#: ../../c-api/arg.rst:378
+#: ../../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."
msgstr ""
-#: ../../c-api/arg.rst:382
+#: ../../c-api/arg.rst:394
msgid ""
"Note that any Python object references which are provided to the caller are "
"*borrowed* references; do not release them (i.e. do not decrement their "
"reference count)!"
msgstr ""
-#: ../../c-api/arg.rst:386
+#: ../../c-api/arg.rst:398
msgid ""
"Additional arguments passed to these functions must be addresses of "
"variables whose type is determined by the format string; these are used to "
@@ -741,7 +768,7 @@ msgid ""
"unit in that case."
msgstr ""
-#: ../../c-api/arg.rst:392
+#: ../../c-api/arg.rst:404
msgid ""
"For the conversion to succeed, the *arg* object must match the format and "
"the format must be exhausted. On success, the ``PyArg_Parse*`` functions "
@@ -751,24 +778,24 @@ msgid ""
"the following format units are left untouched."
msgstr ""
-#: ../../c-api/arg.rst:401
+#: ../../c-api/arg.rst:413
msgid "API Functions"
msgstr "API 函式"
-#: ../../c-api/arg.rst:405
+#: ../../c-api/arg.rst:417
msgid ""
"Parse the parameters of a function that takes only positional parameters "
"into local variables. Returns true on success; on failure, it returns false "
"and raises the appropriate exception."
msgstr ""
-#: ../../c-api/arg.rst:412
+#: ../../c-api/arg.rst:424
msgid ""
"Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list "
"rather than a variable number of arguments."
msgstr ""
-#: ../../c-api/arg.rst:418
+#: ../../c-api/arg.rst:430
msgid ""
"Parse the parameters of a function that takes both positional and keyword "
"parameters into local variables. The *keywords* argument is a ``NULL``-"
@@ -778,51 +805,51 @@ msgid ""
"failure, it returns false and raises the appropriate exception."
msgstr ""
-#: ../../c-api/arg.rst:429
+#: ../../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."
msgstr ""
-#: ../../c-api/arg.rst:433
+#: ../../c-api/arg.rst:445
msgid ""
"Added support for :ref:`positional-only parameters `."
-msgstr ""
+msgstr "新增對\\ :ref:`僅限位置參數 `\\ 的支援。"
-#: ../../c-api/arg.rst:437
+#: ../../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."
msgstr ""
-#: ../../c-api/arg.rst:446
+#: ../../c-api/arg.rst:458
msgid ""
"Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a "
"va_list rather than a variable number of arguments."
msgstr ""
-#: ../../c-api/arg.rst:452
+#: ../../c-api/arg.rst:464
msgid ""
"Ensure that the keys in the keywords argument dictionary are strings. This "
"is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since "
"the latter already does this check."
msgstr ""
-#: ../../c-api/arg.rst:461
+#: ../../c-api/arg.rst:473
msgid ""
"Parse the parameter of a function that takes a single positional parameter "
"into a local variable. Returns true on success; on failure, it returns "
"false and raises the appropriate exception."
msgstr ""
-#: ../../c-api/arg.rst:465
+#: ../../c-api/arg.rst:477
msgid "Example::"
msgstr "舉例來說: ::"
-#: ../../c-api/arg.rst:467
+#: ../../c-api/arg.rst:479
msgid ""
"// Function using METH_O calling convention\n"
"static PyObject*\n"
@@ -836,7 +863,7 @@ msgid ""
"}"
msgstr ""
-#: ../../c-api/arg.rst:481
+#: ../../c-api/arg.rst:493
msgid ""
"A simpler form of parameter retrieval which does not use a format string to "
"specify the types of the arguments. Functions which use this method to "
@@ -854,13 +881,13 @@ msgid ""
"if there was a failure."
msgstr ""
-#: ../../c-api/arg.rst:496
+#: ../../c-api/arg.rst:508
msgid ""
"This is an example of the use of this function, taken from the sources for "
"the :mod:`!_weakref` helper module for weak references::"
msgstr ""
-#: ../../c-api/arg.rst:499
+#: ../../c-api/arg.rst:511
msgid ""
"static PyObject *\n"
"weakref_ref(PyObject *self, PyObject *args)\n"
@@ -888,17 +915,17 @@ msgstr ""
" return result;\n"
"}"
-#: ../../c-api/arg.rst:512
+#: ../../c-api/arg.rst:524
msgid ""
"The call to :c:func:`PyArg_UnpackTuple` in this example is entirely "
"equivalent to this call to :c:func:`PyArg_ParseTuple`::"
msgstr ""
-#: ../../c-api/arg.rst:515
+#: ../../c-api/arg.rst:527
msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)"
msgstr "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)"
-#: ../../c-api/arg.rst:519
+#: ../../c-api/arg.rst:531
msgid ""
"The value to be inserted, if any, before :c:expr:`char * const *` in the "
"*keywords* parameter declaration of :c:func:`PyArg_ParseTupleAndKeywords` "
@@ -907,11 +934,11 @@ msgid ""
"to the desired value before including :file:`Python.h`."
msgstr ""
-#: ../../c-api/arg.rst:533
+#: ../../c-api/arg.rst:545
msgid "Building values"
-msgstr ""
+msgstr "建置數值"
-#: ../../c-api/arg.rst:537
+#: ../../c-api/arg.rst:549
msgid ""
"Create a new value based on a format string similar to those accepted by the "
"``PyArg_Parse*`` family of functions and a sequence of values. Returns the "
@@ -919,7 +946,7 @@ msgid ""
"``NULL`` is returned."
msgstr ""
-#: ../../c-api/arg.rst:542
+#: ../../c-api/arg.rst:554
msgid ""
":c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple "
"only if its format string contains two or more format units. If the format "
@@ -928,7 +955,7 @@ msgid ""
"it to return a tuple of size 0 or one, parenthesize the format string."
msgstr ""
-#: ../../c-api/arg.rst:548
+#: ../../c-api/arg.rst:560
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. "
@@ -939,7 +966,7 @@ msgid ""
"`Py_BuildValue` returns."
msgstr ""
-#: ../../c-api/arg.rst:556
+#: ../../c-api/arg.rst:568
msgid ""
"In the following description, the quoted form is the format unit; the entry "
"in (round) parentheses is the Python object type that the format unit will "
@@ -947,155 +974,155 @@ msgid ""
"be passed."
msgstr ""
-#: ../../c-api/arg.rst:560
+#: ../../c-api/arg.rst:572
msgid ""
"The characters space, tab, colon and comma are ignored in format strings "
"(but not within format units such as ``s#``). This can be used to make long "
"format strings a tad more readable."
msgstr ""
-#: ../../c-api/arg.rst:564
+#: ../../c-api/arg.rst:576
msgid "``s`` (:class:`str` or ``None``) [const char \\*]"
-msgstr "``s``\\ (:class:`str` 或 ``None``)[const char \\*]"
+msgstr "``s`` (:class:`str` 或 ``None``) [const char \\*]"
-#: ../../c-api/arg.rst:565
+#: ../../c-api/arg.rst:577
msgid ""
"Convert a null-terminated C string to a Python :class:`str` object using "
"``'utf-8'`` encoding. If the C string pointer is ``NULL``, ``None`` is used."
msgstr ""
-#: ../../c-api/arg.rst:568
+#: ../../c-api/arg.rst:580
msgid ""
"``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]"
msgstr ""
-"``s#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]"
+"``s#`` (:class:`str` 或 ``None``) [const char \\*, :c:type:`Py_ssize_t`]"
-#: ../../c-api/arg.rst:569
+#: ../../c-api/arg.rst:581
msgid ""
"Convert a C string and its length to a Python :class:`str` object using "
"``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is "
"ignored and ``None`` is returned."
msgstr ""
-#: ../../c-api/arg.rst:573
+#: ../../c-api/arg.rst:585
msgid "``y`` (:class:`bytes`) [const char \\*]"
msgstr "``y`` (:class:`bytes`) [const char \\*]"
-#: ../../c-api/arg.rst:574
+#: ../../c-api/arg.rst:586
msgid ""
"This converts a C string to a Python :class:`bytes` object. If the C string "
"pointer is ``NULL``, ``None`` is returned."
msgstr ""
-#: ../../c-api/arg.rst:577
+#: ../../c-api/arg.rst:589
msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]"
msgstr "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]"
-#: ../../c-api/arg.rst:578
+#: ../../c-api/arg.rst:590
msgid ""
"This converts a C string and its lengths to a Python object. If the C "
"string pointer is ``NULL``, ``None`` is returned."
msgstr ""
-#: ../../c-api/arg.rst:582 ../../c-api/arg.rst:598
+#: ../../c-api/arg.rst:594 ../../c-api/arg.rst:610
msgid "Same as ``s``."
msgstr "和 ``s`` 相同。"
-#: ../../c-api/arg.rst:584
+#: ../../c-api/arg.rst:596
msgid ""
"``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]"
msgstr ""
-"``z#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]"
+"``z#`` (:class:`str` 或 ``None``) [const char \\*, :c:type:`Py_ssize_t`]"
-#: ../../c-api/arg.rst:585 ../../c-api/arg.rst:601
+#: ../../c-api/arg.rst:597 ../../c-api/arg.rst:613
msgid "Same as ``s#``."
msgstr "和 ``s#`` 相同。"
-#: ../../c-api/arg.rst:587
+#: ../../c-api/arg.rst:599
msgid "``u`` (:class:`str`) [const wchar_t \\*]"
msgstr "``u`` (:class:`str`) [const wchar_t \\*]"
-#: ../../c-api/arg.rst:588
+#: ../../c-api/arg.rst:600
msgid ""
"Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or "
"UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is "
"``NULL``, ``None`` is returned."
msgstr ""
-#: ../../c-api/arg.rst:592
+#: ../../c-api/arg.rst:604
msgid "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]"
msgstr "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]"
-#: ../../c-api/arg.rst:593
+#: ../../c-api/arg.rst:605
msgid ""
"Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python "
"Unicode object. If the Unicode buffer pointer is ``NULL``, the length is "
"ignored and ``None`` is returned."
msgstr ""
-#: ../../c-api/arg.rst:597
+#: ../../c-api/arg.rst:609
msgid "``U`` (:class:`str` or ``None``) [const char \\*]"
-msgstr "``U``\\ (:class:`str` 或 ``None``)[const char \\*]"
+msgstr "``U`` (:class:`str` 或 ``None``) [const char \\*]"
-#: ../../c-api/arg.rst:600
+#: ../../c-api/arg.rst:612
msgid ""
"``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]"
msgstr ""
-"``U#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]"
+"``U#`` (:class:`str` 或 ``None``) [const char \\*, :c:type:`Py_ssize_t`]"
-#: ../../c-api/arg.rst:604
+#: ../../c-api/arg.rst:616
msgid "Convert a plain C :c:expr:`int` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`int` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:606
+#: ../../c-api/arg.rst:618
msgid "``b`` (:class:`int`) [char]"
msgstr "``b`` (:class:`int`) [char]"
-#: ../../c-api/arg.rst:607
+#: ../../c-api/arg.rst:619
msgid "Convert a plain C :c:expr:`char` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`char` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:610
+#: ../../c-api/arg.rst:622
msgid "Convert a plain C :c:expr:`short int` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`short int` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:613
+#: ../../c-api/arg.rst:625
msgid "Convert a C :c:expr:`long int` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`long int` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:616
+#: ../../c-api/arg.rst:628
msgid "Convert a C :c:expr:`unsigned char` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`unsigned char` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:619
+#: ../../c-api/arg.rst:631
msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`unsigned short int` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:622
+#: ../../c-api/arg.rst:634
msgid "Convert a C :c:expr:`unsigned int` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`unsigned int` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:625
+#: ../../c-api/arg.rst:637
msgid "Convert a C :c:expr:`unsigned long` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`unsigned long` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:628
+#: ../../c-api/arg.rst:640
msgid "Convert a C :c:expr:`long long` to a Python integer object."
msgstr "將一個 C 的 :c:expr:`long long` 轉換成 Python 整數物件。"
-#: ../../c-api/arg.rst:631
+#: ../../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:634
+#: ../../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:636
+#: ../../c-api/arg.rst:650
msgid "``c`` (:class:`bytes` of length 1) [char]"
-msgstr "``c``\\ (長度為 1 的 :class:`bytes`)[char]"
+msgstr "``c`` (長度為 1 的 :class:`bytes`) [char]"
-#: ../../c-api/arg.rst:637
+#: ../../c-api/arg.rst:651
msgid ""
"Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` "
"object of length 1."
@@ -1103,7 +1130,7 @@ msgstr ""
"將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:"
"`bytes`。"
-#: ../../c-api/arg.rst:641
+#: ../../c-api/arg.rst:655
msgid ""
"Convert a C :c:expr:`int` representing a character to Python :class:`str` "
"object of length 1."
@@ -1111,23 +1138,23 @@ msgstr ""
"將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:"
"`str`。"
-#: ../../c-api/arg.rst:645
+#: ../../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:648
+#: ../../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:650
+#: ../../c-api/arg.rst:664
msgid "``D`` (:class:`complex`) [Py_complex \\*]"
msgstr "``D`` (:class:`complex`) [Py_complex \\*]"
-#: ../../c-api/arg.rst:651
+#: ../../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:654
+#: ../../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 "
@@ -1137,26 +1164,30 @@ msgid ""
"no exception has been raised yet, :exc:`SystemError` is set."
msgstr ""
-#: ../../c-api/arg.rst:663
+#: ../../c-api/arg.rst:677
msgid "``S`` (object) [PyObject \\*]"
-msgstr "``S``\\ (物件)[PyObject \\*]"
+msgstr "``S`` (object) [PyObject \\*]"
-#: ../../c-api/arg.rst:664
+#: ../../c-api/arg.rst:678
msgid "Same as ``O``."
msgstr "和 ``O`` 相同。"
-#: ../../c-api/arg.rst:666
+#: ../../c-api/arg.rst:680
msgid "``N`` (object) [PyObject \\*]"
-msgstr "``N``\\ (物件)[PyObject \\*]"
+msgstr "``N`` (object) [PyObject \\*]"
-#: ../../c-api/arg.rst:667
+#: ../../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:672
+#: ../../c-api/arg.rst:685
+msgid "``O&`` (object) [*converter*, *anything*]"
+msgstr "``O&`` (object) [*converter*, *anything*]"
+
+#: ../../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:"
@@ -1164,40 +1195,40 @@ msgid ""
"``NULL`` if an error occurred."
msgstr ""
-#: ../../c-api/arg.rst:678
+#: ../../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:680
+#: ../../c-api/arg.rst:694
msgid "``[items]`` (:class:`list`) [*matching-items*]"
msgstr "``[items]`` (:class:`list`) [*matching-items*]"
-#: ../../c-api/arg.rst:681
+#: ../../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:683
+#: ../../c-api/arg.rst:697
msgid "``{items}`` (:class:`dict`) [*matching-items*]"
msgstr "``{items}`` (:class:`dict`) [*matching-items*]"
-#: ../../c-api/arg.rst:684
+#: ../../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:688
+#: ../../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:693
+#: ../../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/frame.po b/c-api/frame.po
index 1616a3cc27..da34208fb5 100644
--- a/c-api/frame.po
+++ b/c-api/frame.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: 2024-12-12 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-"
@@ -154,34 +154,61 @@ msgid ""
msgstr ""
#: ../../c-api/frame.rst:134
-msgid "As part of :pep:`667`, return a proxy object for optimized scopes."
+msgid ""
+"As part of :pep:`667`, return an instance of :c:var:"
+"`PyFrameLocalsProxy_Type`."
msgstr ""
#: ../../c-api/frame.rst:140
msgid "Return the line number that *frame* is currently executing."
msgstr ""
-#: ../../c-api/frame.rst:145
+#: ../../c-api/frame.rst:144
+msgid "Frame Locals Proxies"
+msgstr ""
+
+#: ../../c-api/frame.rst:148
+msgid ""
+"The :attr:`~frame.f_locals` attribute on a :ref:`frame object ` is an instance of a \"frame-locals proxy\". The proxy object "
+"exposes a write-through view of the underlying locals dictionary for the "
+"frame. This ensures that the variables exposed by ``f_locals`` are always up "
+"to date with the live local variables in the frame itself."
+msgstr ""
+
+#: ../../c-api/frame.rst:154
+msgid "See :pep:`667` for more information."
+msgstr ""
+
+#: ../../c-api/frame.rst:158
+msgid "The type of frame :func:`locals` proxy objects."
+msgstr ""
+
+#: ../../c-api/frame.rst:162
+msgid "Return non-zero if *obj* is a frame :func:`locals` proxy."
+msgstr ""
+
+#: ../../c-api/frame.rst:165
msgid "Internal Frames"
msgstr ""
-#: ../../c-api/frame.rst:147
+#: ../../c-api/frame.rst:167
msgid "Unless using :pep:`523`, you will not need this."
msgstr ""
-#: ../../c-api/frame.rst:151
+#: ../../c-api/frame.rst:171
msgid "The interpreter's internal frame representation."
msgstr ""
-#: ../../c-api/frame.rst:157
+#: ../../c-api/frame.rst:177
msgid "Return a :term:`strong reference` to the code object for the frame."
msgstr ""
-#: ../../c-api/frame.rst:164
+#: ../../c-api/frame.rst:184
msgid "Return the byte offset into the last executed instruction."
msgstr ""
-#: ../../c-api/frame.rst:171
+#: ../../c-api/frame.rst:191
msgid ""
"Return the currently executing line number, or -1 if there is no line number."
msgstr ""
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 5809d4bf46..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: 2024-11-25 00:14+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-"
@@ -205,10 +205,8 @@ msgstr ":c:func:`PyMutex_Unlock`"
msgid ""
"Despite their apparent similarity to some of the functions listed above, the "
"following functions **should not be called** before the interpreter has been "
-"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:"
-"`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:"
-"`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:"
-"`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, and :c:func:`Py_RunMain`."
+"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, "
+"and :c:func:`Py_RunMain`."
msgstr ""
#: ../../c-api/init.rst:90
@@ -218,30 +216,30 @@ msgstr ""
#: ../../c-api/init.rst:92
msgid ""
"Python has variables for the global configuration to control different "
-"features and options. By default, these flags are controlled by :ref:"
-"`command line options `."
+"features and options. By default, these flags are controlled "
+"by :ref:`command line options `."
msgstr ""
#: ../../c-api/init.rst:96
msgid ""
"When a flag is set by an option, the value of the flag is the number of "
-"times that the option was set. For example, ``-b`` sets :c:data:"
-"`Py_BytesWarningFlag` to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to "
-"2."
+"times that the option was set. For example, ``-b`` "
+"sets :c:data:`Py_BytesWarningFlag` to 1 and ``-bb`` "
+"sets :c:data:`Py_BytesWarningFlag` to 2."
msgstr ""
#: ../../c-api/init.rst:102
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"bytes_warning` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.bytes_warning` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:106
msgid ""
-"Issue a warning when comparing :class:`bytes` or :class:`bytearray` with :"
-"class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater "
-"or equal to ``2``."
+"Issue a warning when comparing :class:`bytes` or :class:`bytearray` "
+"with :class:`str` or :class:`bytes` with :class:`int`. Issue an error if "
+"greater or equal to ``2``."
msgstr ""
#: ../../c-api/init.rst:110
@@ -250,9 +248,9 @@ msgstr "由 :option:`-b` 選項設定。"
#: ../../c-api/init.rst:116
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"parser_debug` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.parser_debug` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:120
@@ -269,9 +267,9 @@ msgstr "由 :option:`-d` 選項與 :envvar:`PYTHONDEBUG` 環境變數設定。"
#: ../../c-api/init.rst:130
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"write_bytecode` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.write_bytecode` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:134
@@ -289,15 +287,15 @@ msgstr ""
#: ../../c-api/init.rst:144
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"pathconfig_warnings` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.pathconfig_warnings` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:148
msgid ""
-"Suppress error messages when calculating the module search path in :c:func:"
-"`Py_GetPath`."
+"Suppress error messages when calculating the module search path "
+"in :c:func:`Py_GetPath`."
msgstr ""
#: ../../c-api/init.rst:151
@@ -306,8 +304,9 @@ msgstr ""
#: ../../c-api/init.rst:157
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"hash_seed` and :c:member:`PyConfig.use_hash_seed` should be used instead, "
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.hash_seed` "
+"and :c:member:`PyConfig.use_hash_seed` should be used instead, "
"see :ref:`Python Initialization Configuration `."
msgstr ""
@@ -326,15 +325,15 @@ msgstr ""
#: ../../c-api/init.rst:172
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"use_environment` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.use_environment` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:176
msgid ""
-"Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:"
-"`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set."
+"Ignore all :envvar:`!PYTHON*` environment variables, "
+"e.g. :envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set."
msgstr ""
"忽略所有可能被設定的 :envvar:`!PYTHON*` 環境變數,例如 :envvar:`PYTHONPATH` "
"與 :envvar:`PYTHONHOME`。"
@@ -345,9 +344,9 @@ msgstr "由 :option:`-E` 與 :option:`-I` 選項設定。"
#: ../../c-api/init.rst:185
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"inspect` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.inspect` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:189
@@ -365,9 +364,9 @@ msgstr "由 :option:`-i` 選項與 :envvar:`PYTHONINSPECT` 環境變數設定。
#: ../../c-api/init.rst:200
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"interactive` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.interactive` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:204
@@ -376,9 +375,9 @@ msgstr "由 :option:`-i` 選項設定。"
#: ../../c-api/init.rst:210
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"isolated` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.isolated` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:214
@@ -393,9 +392,9 @@ msgstr "由 :option:`-i` 選項設定。"
#: ../../c-api/init.rst:225
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyPreConfig."
-"legacy_windows_fs_encoding` should be used instead, see :ref:`Python "
-"Initialization Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyPreConfig.legacy_windows_fs_encoding` should be used "
+"instead, see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:229
@@ -423,15 +422,15 @@ msgstr ""
#: ../../c-api/init.rst:244
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"legacy_windows_stdio` should be used instead, see :ref:`Python "
-"Initialization Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.legacy_windows_stdio` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:248
msgid ""
-"If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!io."
-"_WindowsConsoleIO` for :mod:`sys` standard streams."
+"If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!"
+"io._WindowsConsoleIO` for :mod:`sys` standard streams."
msgstr ""
#: ../../c-api/init.rst:251
@@ -446,17 +445,17 @@ msgstr "更多詳情請見 :pep:`528`。"
#: ../../c-api/init.rst:262
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"site_import` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.site_import` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:266
msgid ""
"Disable the import of the module :mod:`site` and the site-dependent "
"manipulations of :data:`sys.path` that it entails. Also disable these "
-"manipulations if :mod:`site` is explicitly imported later (call :func:`site."
-"main` if you want them to be triggered)."
+"manipulations if :mod:`site` is explicitly imported later "
+"(call :func:`site.main` if you want them to be triggered)."
msgstr ""
#: ../../c-api/init.rst:271
@@ -465,30 +464,30 @@ msgstr "由 :option:`-S` 選項設定。"
#: ../../c-api/init.rst:277
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"user_site_directory` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.user_site_directory` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:281
msgid ""
-"Don't add the :data:`user site-packages directory ` to :data:"
-"`sys.path`."
+"Don't add the :data:`user site-packages directory ` "
+"to :data:`sys.path`."
msgstr ""
#: ../../c-api/init.rst:284
msgid ""
-"Set by the :option:`-s` and :option:`-I` options, and the :envvar:"
-"`PYTHONNOUSERSITE` environment variable."
+"Set by the :option:`-s` and :option:`-I` options, and "
+"the :envvar:`PYTHONNOUSERSITE` environment variable."
msgstr ""
"由 :option:`-s` 選項、:option:`-I` 選項與 :envvar:`PYTHONNOUSERSITE` 環境變數"
"設定。"
#: ../../c-api/init.rst:291
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"optimization_level` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.optimization_level` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:295
@@ -499,9 +498,9 @@ msgstr "由 :option:`-O` 選項與 :envvar:`PYTHONOPTIMIZE` 環境變數設定
#: ../../c-api/init.rst:302
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"quiet` should be used instead, see :ref:`Python Initialization Configuration "
-"`."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.quiet` should be used instead, see :ref:`Python "
+"Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:306
@@ -515,9 +514,9 @@ msgstr "由 :option:`-q` 選項設定。"
#: ../../c-api/init.rst:316
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"buffered_stdio` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.buffered_stdio` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:320
@@ -532,9 +531,9 @@ msgstr "由 :option:`-u` 選項與 :envvar:`PYTHONUNBUFFERED` 環境變數設定
#: ../../c-api/init.rst:329
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"verbose` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.verbose` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
#: ../../c-api/init.rst:333
@@ -558,8 +557,9 @@ msgstr ""
#: ../../c-api/init.rst:360
msgid ""
"Initialize the Python interpreter. In an application embedding Python, "
-"this should be called before using any other Python/C API functions; see :"
-"ref:`Before Python Initialization ` for the few exceptions."
+"this should be called before using any other Python/C API functions; "
+"see :ref:`Before Python Initialization ` for the few "
+"exceptions."
msgstr ""
#: ../../c-api/init.rst:364
@@ -622,19 +622,20 @@ msgstr ""
#: ../../c-api/init.rst:417
msgid ""
"Undo all initializations made by :c:func:`Py_Initialize` and subsequent use "
-"of Python/C API functions, and destroy all sub-interpreters (see :c:func:"
-"`Py_NewInterpreter` below) that were created and not yet destroyed since the "
-"last call to :c:func:`Py_Initialize`. Ideally, this frees all memory "
-"allocated by the Python interpreter. This is a no-op when called for a "
-"second time (without calling :c:func:`Py_Initialize` again first)."
+"of Python/C API functions, and destroy all sub-interpreters "
+"(see :c:func:`Py_NewInterpreter` below) that were created and not yet "
+"destroyed since the last call to :c:func:`Py_Initialize`. Ideally, this "
+"frees all memory allocated by the Python interpreter. This is a no-op when "
+"called for a second time (without calling :c:func:`Py_Initialize` again "
+"first)."
msgstr ""
#: ../../c-api/init.rst:424
msgid ""
"Since this is the reverse of :c:func:`Py_Initialize`, it should be called in "
"the same thread with the same interpreter active. That means the main "
-"thread and the main interpreter. This should never be called while :c:func:"
-"`Py_RunMain` is running."
+"thread and the main interpreter. This should never be called "
+"while :c:func:`Py_RunMain` is running."
msgstr ""
#: ../../c-api/init.rst:429
@@ -671,11 +672,11 @@ msgstr ""
#: ../../c-api/init.rst:452
msgid ""
-"Raises an :ref:`auditing event ` ``cpython."
-"_PySys_ClearAuditHooks`` with no arguments."
+"Raises an :ref:`auditing event ` "
+"``cpython._PySys_ClearAuditHooks`` with no arguments."
msgstr ""
-"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython."
-"_PySys_ClearAuditHooks``。"
+"引發一個不附帶引數的\\ :ref:`稽核事件 ` "
+"``cpython._PySys_ClearAuditHooks``。"
#: ../../c-api/init.rst:459
msgid ""
@@ -735,9 +736,9 @@ msgstr ""
#: ../../c-api/init.rst:503
msgid ""
-"In terms of the CPython runtime configuration APIs documented in the :ref:"
-"`runtime configuration ` section (and without accounting for "
-"error handling), ``Py_Main`` is approximately equivalent to::"
+"In terms of the CPython runtime configuration APIs documented in "
+"the :ref:`runtime configuration ` section (and without "
+"accounting for error handling), ``Py_Main`` is approximately equivalent to::"
msgstr ""
#: ../../c-api/init.rst:507
@@ -754,14 +755,14 @@ msgstr ""
#: ../../c-api/init.rst:515
msgid ""
"In normal usage, an embedding application will call this function *instead* "
-"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` or :c:func:"
-"`Py_InitializeFromConfig` directly, and all settings will be applied as "
-"described elsewhere in this documentation. If this function is instead "
-"called *after* a preceding runtime initialization API call, then exactly "
-"which environmental and command line configuration settings will be updated "
-"is version dependent (as it depends on which settings correctly support "
-"being modified after they have already been set once when the runtime was "
-"first initialized)."
+"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` "
+"or :c:func:`Py_InitializeFromConfig` directly, and all settings will be "
+"applied as described elsewhere in this documentation. If this function is "
+"instead called *after* a preceding runtime initialization API call, then "
+"exactly which environmental and command line configuration settings will be "
+"updated is version dependent (as it depends on which settings correctly "
+"support being modified after they have already been set once when the "
+"runtime was first initialized)."
msgstr ""
#: ../../c-api/init.rst:528
@@ -770,11 +771,11 @@ msgstr ""
#: ../../c-api/init.rst:530
msgid ""
-"Executes the command (:c:member:`PyConfig.run_command`), the script (:c:"
-"member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig."
-"run_module`) specified on the command line or in the configuration. If none "
-"of these values are set, runs the interactive Python prompt (REPL) using the "
-"``__main__`` module's global namespace."
+"Executes the command (:c:member:`PyConfig.run_command`), the script "
+"(:c:member:`PyConfig.run_filename`) or the module "
+"(:c:member:`PyConfig.run_module`) specified on the command line or in the "
+"configuration. If none of these values are set, runs the interactive Python "
+"prompt (REPL) using the ``__main__`` module's global namespace."
msgstr ""
#: ../../c-api/init.rst:536
@@ -802,29 +803,40 @@ msgstr ""
#: ../../c-api/init.rst:552
msgid ""
"This function always finalizes the Python interpreter regardless of whether "
-"it returns a value or immediately exits the process due to an unhandled :exc:"
-"`SystemExit` exception."
+"it returns a value or immediately exits the process due to an "
+"unhandled :exc:`SystemExit` exception."
msgstr ""
#: ../../c-api/init.rst:556
msgid ""
"See :ref:`Python Configuration ` for an example of a "
-"customized Python that always runs in isolated mode using :c:func:"
-"`Py_RunMain`."
+"customized Python that always runs in isolated mode "
+"using :c:func:`Py_RunMain`."
msgstr ""
#: ../../c-api/init.rst:562
+msgid ""
+"Register an :mod:`atexit` callback for the target interpreter *interp*. This "
+"is similar to :c:func:`Py_AtExit`, but takes an explicit interpreter and "
+"data pointer for the callback."
+msgstr ""
+
+#: ../../c-api/init.rst:566
+msgid "The :term:`GIL` must be held for *interp*."
+msgstr ""
+
+#: ../../c-api/init.rst:571
msgid "Process-wide parameters"
msgstr ""
-#: ../../c-api/init.rst:572
+#: ../../c-api/init.rst:581
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"program_name` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.program_name` should be used instead, "
+"see :ref:`Python Initialization Configuration `."
msgstr ""
-#: ../../c-api/init.rst:576
+#: ../../c-api/init.rst:585
msgid ""
"This function should be called before :c:func:`Py_Initialize` is called for "
"the first time, if it is called at all. It tells the interpreter the value "
@@ -838,37 +850,37 @@ msgid ""
"this storage."
msgstr ""
-#: ../../c-api/init.rst:587 ../../c-api/init.rst:829 ../../c-api/init.rst:865
-#: ../../c-api/init.rst:891
+#: ../../c-api/init.rst:596 ../../c-api/init.rst:838 ../../c-api/init.rst:874
+#: ../../c-api/init.rst:900
msgid ""
-"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:"
-"`wchar_*` string."
+"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get "
+"a :c:expr:`wchar_t*` string."
msgstr ""
-#: ../../c-api/init.rst:595
+#: ../../c-api/init.rst:604
msgid ""
"Return the program name set with :c:member:`PyConfig.program_name`, or the "
"default. The returned string points into static storage; the caller should "
"not modify its value."
msgstr ""
-#: ../../c-api/init.rst:599 ../../c-api/init.rst:621 ../../c-api/init.rst:667
-#: ../../c-api/init.rst:689 ../../c-api/init.rst:715 ../../c-api/init.rst:903
+#: ../../c-api/init.rst:608 ../../c-api/init.rst:630 ../../c-api/init.rst:676
+#: ../../c-api/init.rst:698 ../../c-api/init.rst:724 ../../c-api/init.rst:912
msgid ""
"This function should not be called before :c:func:`Py_Initialize`, otherwise "
"it returns ``NULL``."
msgstr "此函式不應該在 :c:func:`Py_Initialize` 之前呼叫,否則會回傳 ``NULL``。"
-#: ../../c-api/init.rst:602 ../../c-api/init.rst:624 ../../c-api/init.rst:670
-#: ../../c-api/init.rst:692 ../../c-api/init.rst:720 ../../c-api/init.rst:906
+#: ../../c-api/init.rst:611 ../../c-api/init.rst:633 ../../c-api/init.rst:679
+#: ../../c-api/init.rst:701 ../../c-api/init.rst:729 ../../c-api/init.rst:915
msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`."
msgstr "如果在 :c:func:`Py_Initialize` 之前呼叫,現在會回傳 ``NULL``。"
-#: ../../c-api/init.rst:605 ../../c-api/init.rst:695
+#: ../../c-api/init.rst:614 ../../c-api/init.rst:704
msgid "Get :data:`sys.executable` instead."
msgstr ""
-#: ../../c-api/init.rst:611
+#: ../../c-api/init.rst:620
msgid ""
"Return the *prefix* for installed platform-independent files. This is "
"derived through a number of complicated rules from the program name set "
@@ -882,27 +894,27 @@ msgid ""
"See also the next function."
msgstr ""
-#: ../../c-api/init.rst:627
+#: ../../c-api/init.rst:636
msgid ""
"Get :data:`sys.base_prefix` instead, or :data:`sys.prefix` if :ref:`virtual "
"environments ` need to be handled."
msgstr ""
-#: ../../c-api/init.rst:634
+#: ../../c-api/init.rst:643
msgid ""
"Return the *exec-prefix* for installed platform-*dependent* files. This is "
"derived through a number of complicated rules from the program name set "
"with :c:member:`PyConfig.program_name` and some environment variables; for "
"example, if the program name is ``'/usr/local/bin/python'``, the exec-prefix "
"is ``'/usr/local'``. The returned string points into static storage; the "
-"caller should not modify its value. This corresponds to the :makevar:"
-"`exec_prefix` variable in the top-level :file:`Makefile` and the ``--exec-"
-"prefix`` argument to the :program:`configure` script at build time. The "
-"value is available to Python code as ``sys.base_exec_prefix``. It is only "
-"useful on Unix."
+"caller should not modify its value. This corresponds to "
+"the :makevar:`exec_prefix` variable in the top-level :file:`Makefile` and "
+"the ``--exec-prefix`` argument to the :program:`configure` script at build "
+"time. The value is available to Python code as ``sys.base_exec_prefix``. "
+"It is only useful on Unix."
msgstr ""
-#: ../../c-api/init.rst:645
+#: ../../c-api/init.rst:654
msgid ""
"Background: The exec-prefix differs from the prefix when platform dependent "
"files (such as executables and shared libraries) are installed in a "
@@ -911,7 +923,7 @@ msgid ""
"independent may be installed in :file:`/usr/local`."
msgstr ""
-#: ../../c-api/init.rst:651
+#: ../../c-api/init.rst:660
msgid ""
"Generally speaking, a platform is a combination of hardware and software "
"families, e.g. Sparc machines running the Solaris 2.x operating system are "
@@ -925,21 +937,21 @@ msgid ""
"independent from the Python version by which they were compiled!)."
msgstr ""
-#: ../../c-api/init.rst:662
+#: ../../c-api/init.rst:671
msgid ""
-"System administrators will know how to configure the :program:`mount` or :"
-"program:`automount` programs to share :file:`/usr/local` between platforms "
-"while having :file:`/usr/local/plat` be a different filesystem for each "
-"platform."
+"System administrators will know how to configure the :program:`mount` "
+"or :program:`automount` programs to share :file:`/usr/local` between "
+"platforms while having :file:`/usr/local/plat` be a different filesystem for "
+"each platform."
msgstr ""
-#: ../../c-api/init.rst:673
+#: ../../c-api/init.rst:682
msgid ""
-"Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if :ref:"
-"`virtual environments ` need to be handled."
+"Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` "
+"if :ref:`virtual environments ` need to be handled."
msgstr ""
-#: ../../c-api/init.rst:683
+#: ../../c-api/init.rst:692
msgid ""
"Return the full program name of the Python executable; this is computed as "
"a side-effect of deriving the default module search path from the program "
@@ -948,7 +960,7 @@ msgid ""
"available to Python code as ``sys.executable``."
msgstr ""
-#: ../../c-api/init.rst:705
+#: ../../c-api/init.rst:714
msgid ""
"Return the default module search path; this is computed from the program "
"name (set by :c:member:`PyConfig.program_name`) and some environment "
@@ -961,34 +973,34 @@ msgid ""
"for loading modules."
msgstr ""
-#: ../../c-api/init.rst:723
+#: ../../c-api/init.rst:732
msgid "Get :data:`sys.path` instead."
msgstr ""
-#: ../../c-api/init.rst:729
+#: ../../c-api/init.rst:738
msgid ""
"Return the version of this Python interpreter. This is a string that looks "
"something like ::"
msgstr ""
-#: ../../c-api/init.rst:732
+#: ../../c-api/init.rst:741
msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\""
msgstr "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\""
-#: ../../c-api/init.rst:736
+#: ../../c-api/init.rst:745
msgid ""
"The first word (up to the first space character) is the current Python "
"version; the first characters are the major and minor version separated by a "
"period. The returned string points into static storage; the caller should "
-"not modify its value. The value is available to Python code as :data:`sys."
-"version`."
+"not modify its value. The value is available to Python code "
+"as :data:`sys.version`."
msgstr ""
-#: ../../c-api/init.rst:741
+#: ../../c-api/init.rst:750
msgid "See also the :c:var:`Py_Version` constant."
msgstr ""
-#: ../../c-api/init.rst:748
+#: ../../c-api/init.rst:757
msgid ""
"Return the platform identifier for the current platform. On Unix, this is "
"formed from the \"official\" name of the operating system, converted to "
@@ -999,58 +1011,58 @@ msgid ""
"available to Python code as ``sys.platform``."
msgstr ""
-#: ../../c-api/init.rst:759
+#: ../../c-api/init.rst:768
msgid ""
"Return the official copyright string for the current Python version, for "
"example"
msgstr ""
-#: ../../c-api/init.rst:761
+#: ../../c-api/init.rst:770
msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``"
msgstr "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``"
-#: ../../c-api/init.rst:765
+#: ../../c-api/init.rst:774
msgid ""
"The returned string points into static storage; the caller should not modify "
"its value. The value is available to Python code as ``sys.copyright``."
msgstr ""
-#: ../../c-api/init.rst:771
+#: ../../c-api/init.rst:780
msgid ""
"Return an indication of the compiler used to build the current Python "
"version, in square brackets, for example::"
msgstr ""
-#: ../../c-api/init.rst:774
+#: ../../c-api/init.rst:783
msgid "\"[GCC 2.7.2.2]\""
msgstr "\"[GCC 2.7.2.2]\""
-#: ../../c-api/init.rst:778 ../../c-api/init.rst:792
+#: ../../c-api/init.rst:787 ../../c-api/init.rst:801
msgid ""
"The returned string points into static storage; the caller should not modify "
"its value. The value is available to Python code as part of the variable "
"``sys.version``."
msgstr ""
-#: ../../c-api/init.rst:785
+#: ../../c-api/init.rst:794
msgid ""
"Return information about the sequence number and build date and time of the "
"current Python interpreter instance, for example ::"
msgstr ""
-#: ../../c-api/init.rst:788
+#: ../../c-api/init.rst:797
msgid "\"#67, Aug 1 1997, 22:34:28\""
msgstr "\"#67, Aug 1 1997, 22:34:28\""
-#: ../../c-api/init.rst:804
+#: ../../c-api/init.rst:813
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` "
-"should be used instead, see :ref:`Python Initialization Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.argv`, :c:member:`PyConfig.parse_argv` "
+"and :c:member:`PyConfig.safe_path` should be used instead, see :ref:`Python "
+"Initialization Configuration `."
msgstr ""
-#: ../../c-api/init.rst:809
+#: ../../c-api/init.rst:818
msgid ""
"Set :data:`sys.argv` based on *argc* and *argv*. These parameters are "
"similar to those passed to the program's :c:func:`main` function with the "
@@ -1061,84 +1073,85 @@ msgid ""
"fatal condition is signalled using :c:func:`Py_FatalError`."
msgstr ""
-#: ../../c-api/init.rst:817
+#: ../../c-api/init.rst:826
msgid ""
"If *updatepath* is zero, this is all the function does. If *updatepath* is "
"non-zero, the function also modifies :data:`sys.path` according to the "
"following algorithm:"
msgstr ""
-#: ../../c-api/init.rst:821
+#: ../../c-api/init.rst:830
msgid ""
"If the name of an existing script is passed in ``argv[0]``, the absolute "
-"path of the directory where the script is located is prepended to :data:`sys."
-"path`."
+"path of the directory where the script is located is prepended "
+"to :data:`sys.path`."
msgstr ""
-#: ../../c-api/init.rst:824
+#: ../../c-api/init.rst:833
msgid ""
"Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an "
"existing file name), an empty string is prepended to :data:`sys.path`, which "
"is the same as prepending the current working directory (``\".\"``)."
msgstr ""
-#: ../../c-api/init.rst:832 ../../c-api/init.rst:868
+#: ../../c-api/init.rst:841 ../../c-api/init.rst:877
msgid ""
"See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` "
"members of the :ref:`Python Initialization Configuration `."
msgstr ""
-#: ../../c-api/init.rst:836
+#: ../../c-api/init.rst:845
msgid ""
"It is recommended that applications embedding the Python interpreter for "
"purposes other than executing a single script pass ``0`` as *updatepath*, "
"and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`."
msgstr ""
-#: ../../c-api/init.rst:841
+#: ../../c-api/init.rst:850
msgid ""
"On versions before 3.1.3, you can achieve the same effect by manually "
-"popping the first :data:`sys.path` element after having called :c:func:"
-"`PySys_SetArgv`, for example using::"
+"popping the first :data:`sys.path` element after having "
+"called :c:func:`PySys_SetArgv`, for example using::"
msgstr ""
-#: ../../c-api/init.rst:845
+#: ../../c-api/init.rst:854
msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");"
msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");"
-#: ../../c-api/init.rst:857
+#: ../../c-api/init.rst:866
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:"
-"`Python Initialization Configuration `."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` should "
+"be used instead, see :ref:`Python Initialization Configuration `."
msgstr ""
-#: ../../c-api/init.rst:861
+#: ../../c-api/init.rst:870
msgid ""
"This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to "
-"``1`` unless the :program:`python` interpreter was started with the :option:"
-"`-I`."
+"``1`` unless the :program:`python` interpreter was started with "
+"the :option:`-I`."
msgstr ""
-#: ../../c-api/init.rst:871
+#: ../../c-api/init.rst:880
msgid "The *updatepath* value depends on :option:`-I`."
msgstr ""
-#: ../../c-api/init.rst:878
+#: ../../c-api/init.rst:887
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"home` should be used instead, see :ref:`Python Initialization Configuration "
-"`."
+"This API is kept for backward compatibility: "
+"setting :c:member:`PyConfig.home` should be used instead, see :ref:`Python "
+"Initialization Configuration `."
msgstr ""
-#: ../../c-api/init.rst:882
+#: ../../c-api/init.rst:891
msgid ""
"Set the default \"home\" directory, that is, the location of the standard "
"Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument "
"string."
msgstr ""
-#: ../../c-api/init.rst:886
+#: ../../c-api/init.rst:895
msgid ""
"The argument should point to a zero-terminated character string in static "
"storage whose contents will not change for the duration of the program's "
@@ -1146,24 +1159,24 @@ msgid ""
"this storage."
msgstr ""
-#: ../../c-api/init.rst:899
+#: ../../c-api/init.rst:908
msgid ""
-"Return the default \"home\", that is, the value set by :c:member:`PyConfig."
-"home`, or the value of the :envvar:`PYTHONHOME` environment variable if it "
-"is set."
+"Return the default \"home\", that is, the value set "
+"by :c:member:`PyConfig.home`, or the value of the :envvar:`PYTHONHOME` "
+"environment variable if it is set."
msgstr ""
-#: ../../c-api/init.rst:909
+#: ../../c-api/init.rst:918
msgid ""
"Get :c:member:`PyConfig.home` or :envvar:`PYTHONHOME` environment variable "
"instead."
msgstr "改為取得 :c:member:`PyConfig.home` 或 :envvar:`PYTHONHOME` 環境變數。"
-#: ../../c-api/init.rst:917
+#: ../../c-api/init.rst:926
msgid "Thread State and the Global Interpreter Lock"
msgstr ""
-#: ../../c-api/init.rst:924
+#: ../../c-api/init.rst:933
msgid ""
"The Python interpreter is not fully thread-safe. In order to support multi-"
"threaded Python programs, there's a global lock, called the :term:`global "
@@ -1175,17 +1188,18 @@ msgid ""
"once instead of twice."
msgstr ""
-#: ../../c-api/init.rst:934
+#: ../../c-api/init.rst:943
msgid ""
-"Therefore, the rule exists that only the thread that has acquired the :term:"
-"`GIL` may operate on Python objects or call Python/C API functions. In order "
-"to emulate concurrency of execution, the interpreter regularly tries to "
-"switch threads (see :func:`sys.setswitchinterval`). The lock is also "
-"released around potentially blocking I/O operations like reading or writing "
-"a file, so that other Python threads can run in the meantime."
+"Therefore, the rule exists that only the thread that has acquired "
+"the :term:`GIL` may operate on Python objects or call Python/C API "
+"functions. In order to emulate concurrency of execution, the interpreter "
+"regularly tries to switch threads (see :func:`sys.setswitchinterval`). The "
+"lock is also released around potentially blocking I/O operations like "
+"reading or writing a file, so that other Python threads can run in the "
+"meantime."
msgstr ""
-#: ../../c-api/init.rst:944
+#: ../../c-api/init.rst:953
msgid ""
"The Python interpreter keeps some thread-specific bookkeeping information "
"inside a data structure called :c:type:`PyThreadState`. There's also one "
@@ -1193,17 +1207,17 @@ msgid ""
"retrieved using :c:func:`PyThreadState_Get`."
msgstr ""
-#: ../../c-api/init.rst:950
+#: ../../c-api/init.rst:959
msgid "Releasing the GIL from extension code"
msgstr ""
-#: ../../c-api/init.rst:952
+#: ../../c-api/init.rst:961
msgid ""
"Most extension code manipulating the :term:`GIL` has the following simple "
"structure::"
msgstr ""
-#: ../../c-api/init.rst:955
+#: ../../c-api/init.rst:964
msgid ""
"Save the thread state in a local variable.\n"
"Release the global interpreter lock.\n"
@@ -1212,29 +1226,29 @@ msgid ""
"Restore the thread state from the local variable."
msgstr ""
-#: ../../c-api/init.rst:961
+#: ../../c-api/init.rst:970
msgid "This is so common that a pair of macros exists to simplify it::"
msgstr ""
-#: ../../c-api/init.rst:963
+#: ../../c-api/init.rst:972
msgid ""
"Py_BEGIN_ALLOW_THREADS\n"
"... Do some blocking I/O operation ...\n"
"Py_END_ALLOW_THREADS"
msgstr ""
-#: ../../c-api/init.rst:971
+#: ../../c-api/init.rst:980
msgid ""
"The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a "
"hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the "
"block."
msgstr ""
-#: ../../c-api/init.rst:975
+#: ../../c-api/init.rst:984
msgid "The block above expands to the following code::"
msgstr ""
-#: ../../c-api/init.rst:977
+#: ../../c-api/init.rst:986
msgid ""
"PyThreadState *_save;\n"
"\n"
@@ -1243,7 +1257,7 @@ msgid ""
"PyEval_RestoreThread(_save);"
msgstr ""
-#: ../../c-api/init.rst:987
+#: ../../c-api/init.rst:996
msgid ""
"Here is how these functions work: the global interpreter lock is used to "
"protect the pointer to the current thread state. When releasing the lock "
@@ -1254,7 +1268,7 @@ msgid ""
"state, the lock must be acquired before storing the thread state pointer."
msgstr ""
-#: ../../c-api/init.rst:996
+#: ../../c-api/init.rst:1005
msgid ""
"Calling system I/O functions is the most common use case for releasing the "
"GIL, but it can also be useful before calling long-running computations "
@@ -1264,21 +1278,21 @@ msgid ""
"compressing or hashing data."
msgstr ""
-#: ../../c-api/init.rst:1007
+#: ../../c-api/init.rst:1016
msgid "Non-Python created threads"
msgstr ""
-#: ../../c-api/init.rst:1009
+#: ../../c-api/init.rst:1018
msgid ""
-"When threads are created using the dedicated Python APIs (such as the :mod:"
-"`threading` module), a thread state is automatically associated to them and "
-"the code showed above is therefore correct. However, when threads are "
-"created from C (for example by a third-party library with its own thread "
+"When threads are created using the dedicated Python APIs (such as "
+"the :mod:`threading` module), a thread state is automatically associated to "
+"them and the code showed above is therefore correct. However, when threads "
+"are created from C (for example by a third-party library with its own thread "
"management), they don't hold the GIL, nor is there a thread state structure "
"for them."
msgstr ""
-#: ../../c-api/init.rst:1016
+#: ../../c-api/init.rst:1025
msgid ""
"If you need to call Python code from these threads (often this will be part "
"of a callback API provided by the aforementioned third-party library), you "
@@ -1289,14 +1303,14 @@ msgid ""
"finally free the thread state data structure."
msgstr ""
-#: ../../c-api/init.rst:1024
+#: ../../c-api/init.rst:1033
msgid ""
"The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions "
"do all of the above automatically. The typical idiom for calling into "
"Python from a C thread is::"
msgstr ""
-#: ../../c-api/init.rst:1028
+#: ../../c-api/init.rst:1037
msgid ""
"PyGILState_STATE gstate;\n"
"gstate = PyGILState_Ensure();\n"
@@ -1309,20 +1323,20 @@ msgid ""
"PyGILState_Release(gstate);"
msgstr ""
-#: ../../c-api/init.rst:1038
+#: ../../c-api/init.rst:1047
msgid ""
"Note that the ``PyGILState_*`` functions assume there is only one global "
"interpreter (created automatically by :c:func:`Py_Initialize`). Python "
-"supports the creation of additional interpreters (using :c:func:"
-"`Py_NewInterpreter`), but mixing multiple interpreters and the "
-"``PyGILState_*`` API is unsupported."
+"supports the creation of additional interpreters "
+"(using :c:func:`Py_NewInterpreter`), but mixing multiple interpreters and "
+"the ``PyGILState_*`` API is unsupported."
msgstr ""
-#: ../../c-api/init.rst:1048
+#: ../../c-api/init.rst:1057
msgid "Cautions about fork()"
msgstr ""
-#: ../../c-api/init.rst:1050
+#: ../../c-api/init.rst:1059
msgid ""
"Another important thing to note about threads is their behaviour in the face "
"of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a "
@@ -1331,7 +1345,7 @@ msgid ""
"CPython's runtime."
msgstr ""
-#: ../../c-api/init.rst:1056
+#: ../../c-api/init.rst:1065
msgid ""
"The fact that only the \"current\" thread remains means any locks held by "
"other threads will never be released. Python solves this for :func:`os.fork` "
@@ -1341,14 +1355,14 @@ msgid ""
"of additional (non-Python) locks that need to be acquired before or reset "
"after a fork. OS facilities such as :c:func:`!pthread_atfork` would need to "
"be used to accomplish the same thing. Additionally, when extending or "
-"embedding Python, calling :c:func:`fork` directly rather than through :func:"
-"`os.fork` (and returning to or calling into Python) may result in a deadlock "
-"by one of Python's internal locks being held by a thread that is defunct "
-"after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the necessary "
-"locks, but is not always able to."
+"embedding Python, calling :c:func:`fork` directly rather than "
+"through :func:`os.fork` (and returning to or calling into Python) may result "
+"in a deadlock by one of Python's internal locks being held by a thread that "
+"is defunct after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the "
+"necessary locks, but is not always able to."
msgstr ""
-#: ../../c-api/init.rst:1071
+#: ../../c-api/init.rst:1080
msgid ""
"The fact that all other threads go away also means that CPython's runtime "
"state there must be cleaned up properly, which :func:`os.fork` does. This "
@@ -1361,17 +1375,17 @@ msgid ""
"called immediately after."
msgstr ""
-#: ../../c-api/init.rst:1084
+#: ../../c-api/init.rst:1093
msgid "High-level API"
msgstr "高階 API"
-#: ../../c-api/init.rst:1086
+#: ../../c-api/init.rst:1095
msgid ""
"These are the most commonly used types and functions when writing C "
"extension code, or when embedding the Python interpreter:"
msgstr ""
-#: ../../c-api/init.rst:1091
+#: ../../c-api/init.rst:1100
msgid ""
"This data structure represents the state shared by a number of cooperating "
"threads. Threads belonging to the same interpreter share their module "
@@ -1379,7 +1393,7 @@ msgid ""
"in this structure."
msgstr ""
-#: ../../c-api/init.rst:1096
+#: ../../c-api/init.rst:1105
msgid ""
"Threads belonging to different interpreters initially share nothing, except "
"process state like available memory, open file descriptors and such. The "
@@ -1387,41 +1401,41 @@ msgid ""
"which interpreter they belong."
msgstr ""
-#: ../../c-api/init.rst:1104
+#: ../../c-api/init.rst:1113
msgid ""
"This data structure represents the state of a single thread. The only "
"public data member is:"
msgstr ""
-#: ../../c-api/init.rst:1109
+#: ../../c-api/init.rst:1118
msgid "This thread's interpreter state."
msgstr ""
-#: ../../c-api/init.rst:1120
+#: ../../c-api/init.rst:1129
msgid "Deprecated function which does nothing."
msgstr ""
-#: ../../c-api/init.rst:1122
+#: ../../c-api/init.rst:1131
msgid ""
"In Python 3.6 and older, this function created the GIL if it didn't exist."
msgstr ""
-#: ../../c-api/init.rst:1124
+#: ../../c-api/init.rst:1133
msgid "The function now does nothing."
msgstr "此函式現在不會做任何事情。"
-#: ../../c-api/init.rst:1127
+#: ../../c-api/init.rst:1136
msgid ""
"This function is now called by :c:func:`Py_Initialize()`, so you don't have "
"to call it yourself anymore."
msgstr ""
-#: ../../c-api/init.rst:1131
+#: ../../c-api/init.rst:1140
msgid ""
"This function cannot be called before :c:func:`Py_Initialize()` anymore."
msgstr ""
-#: ../../c-api/init.rst:1141
+#: ../../c-api/init.rst:1150
msgid ""
"Release the global interpreter lock (if it has been created) and reset the "
"thread state to ``NULL``, returning the previous thread state (which is not "
@@ -1429,7 +1443,7 @@ msgid ""
"acquired it."
msgstr ""
-#: ../../c-api/init.rst:1149
+#: ../../c-api/init.rst:1158
msgid ""
"Acquire the global interpreter lock (if it has been created) and set the "
"thread state to *tstate*, which must not be ``NULL``. If the lock has been "
@@ -1437,8 +1451,8 @@ msgid ""
"ensues."
msgstr ""
-#: ../../c-api/init.rst:1155 ../../c-api/init.rst:1214
-#: ../../c-api/init.rst:1499
+#: ../../c-api/init.rst:1164 ../../c-api/init.rst:1223
+#: ../../c-api/init.rst:1519
msgid ""
"Calling this function from a thread when the runtime is finalizing will "
"terminate the thread, even if the thread was not created by Python. You can "
@@ -1447,87 +1461,87 @@ msgid ""
"avoid unwanted termination."
msgstr ""
-#: ../../c-api/init.rst:1163
+#: ../../c-api/init.rst:1172
msgid ""
"Return the current thread state. The global interpreter lock must be held. "
"When the current thread state is ``NULL``, this issues a fatal error (so "
"that the caller needn't check for ``NULL``)."
msgstr ""
-#: ../../c-api/init.rst:1167
+#: ../../c-api/init.rst:1176
msgid "See also :c:func:`PyThreadState_GetUnchecked`."
msgstr "也請見 :c:func:`PyThreadState_GetUnchecked`。"
-#: ../../c-api/init.rst:1172
+#: ../../c-api/init.rst:1181
msgid ""
"Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a "
"fatal error if it is NULL. The caller is responsible to check if the result "
"is NULL."
msgstr ""
-#: ../../c-api/init.rst:1176
+#: ../../c-api/init.rst:1185
msgid ""
"In Python 3.5 to 3.12, the function was private and known as "
"``_PyThreadState_UncheckedGet()``."
msgstr ""
-#: ../../c-api/init.rst:1183
+#: ../../c-api/init.rst:1192
msgid ""
"Swap the current thread state with the thread state given by the argument "
"*tstate*, which may be ``NULL``. The global interpreter lock must be held "
"and is not released."
msgstr ""
-#: ../../c-api/init.rst:1188
+#: ../../c-api/init.rst:1197
msgid ""
"The following functions use thread-local storage, and are not compatible "
"with sub-interpreters:"
msgstr ""
-#: ../../c-api/init.rst:1193
+#: ../../c-api/init.rst:1202
msgid ""
"Ensure that the current thread is ready to call the Python C API regardless "
"of the current state of Python, or of the global interpreter lock. This may "
"be called as many times as desired by a thread as long as each call is "
"matched with a call to :c:func:`PyGILState_Release`. In general, other "
-"thread-related APIs may be used between :c:func:`PyGILState_Ensure` and :c:"
-"func:`PyGILState_Release` calls as long as the thread state is restored to "
-"its previous state before the Release(). For example, normal usage of the :"
-"c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS` macros "
-"is acceptable."
+"thread-related APIs may be used between :c:func:`PyGILState_Ensure` "
+"and :c:func:`PyGILState_Release` calls as long as the thread state is "
+"restored to its previous state before the Release(). For example, normal "
+"usage of the :c:macro:`Py_BEGIN_ALLOW_THREADS` "
+"and :c:macro:`Py_END_ALLOW_THREADS` macros is acceptable."
msgstr ""
-#: ../../c-api/init.rst:1203
+#: ../../c-api/init.rst:1212
msgid ""
-"The return value is an opaque \"handle\" to the thread state when :c:func:"
-"`PyGILState_Ensure` was called, and must be passed to :c:func:"
-"`PyGILState_Release` to ensure Python is left in the same state. Even though "
-"recursive calls are allowed, these handles *cannot* be shared - each unique "
-"call to :c:func:`PyGILState_Ensure` must save the handle for its call to :c:"
-"func:`PyGILState_Release`."
+"The return value is an opaque \"handle\" to the thread state "
+"when :c:func:`PyGILState_Ensure` was called, and must be passed "
+"to :c:func:`PyGILState_Release` to ensure Python is left in the same state. "
+"Even though recursive calls are allowed, these handles *cannot* be shared - "
+"each unique call to :c:func:`PyGILState_Ensure` must save the handle for its "
+"call to :c:func:`PyGILState_Release`."
msgstr ""
-#: ../../c-api/init.rst:1210
+#: ../../c-api/init.rst:1219
msgid ""
"When the function returns, the current thread will hold the GIL and be able "
"to call arbitrary Python code. Failure is a fatal error."
msgstr ""
-#: ../../c-api/init.rst:1222
+#: ../../c-api/init.rst:1231
msgid ""
"Release any resources previously acquired. After this call, Python's state "
-"will be the same as it was prior to the corresponding :c:func:"
-"`PyGILState_Ensure` call (but generally this state will be unknown to the "
-"caller, hence the use of the GILState API)."
+"will be the same as it was prior to the "
+"corresponding :c:func:`PyGILState_Ensure` call (but generally this state "
+"will be unknown to the caller, hence the use of the GILState API)."
msgstr ""
-#: ../../c-api/init.rst:1227
+#: ../../c-api/init.rst:1236
msgid ""
-"Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:"
-"func:`PyGILState_Release` on the same thread."
+"Every call to :c:func:`PyGILState_Ensure` must be matched by a call "
+"to :c:func:`PyGILState_Release` on the same thread."
msgstr ""
-#: ../../c-api/init.rst:1233
+#: ../../c-api/init.rst:1242
msgid ""
"Get the current thread state for this thread. May return ``NULL`` if no "
"GILState API has been used on the current thread. Note that the main thread "
@@ -1535,7 +1549,7 @@ msgid ""
"made on the main thread. This is mainly a helper/diagnostic function."
msgstr ""
-#: ../../c-api/init.rst:1241
+#: ../../c-api/init.rst:1250
msgid ""
"Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. "
"This function can be called from any thread at any time. Only if it has had "
@@ -1546,241 +1560,248 @@ msgid ""
"otherwise behave differently."
msgstr ""
-#: ../../c-api/init.rst:1253
+#: ../../c-api/init.rst:1262
msgid ""
"The following macros are normally used without a trailing semicolon; look "
"for example usage in the Python source distribution."
msgstr ""
-#: ../../c-api/init.rst:1259
+#: ../../c-api/init.rst:1268
msgid ""
-"This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();"
-"``. Note that it contains an opening brace; it must be matched with a "
-"following :c:macro:`Py_END_ALLOW_THREADS` macro. See above for further "
-"discussion of this macro."
+"This macro expands to ``{ PyThreadState *_save; _save = "
+"PyEval_SaveThread();``. Note that it contains an opening brace; it must be "
+"matched with a following :c:macro:`Py_END_ALLOW_THREADS` macro. See above "
+"for further discussion of this macro."
msgstr ""
-#: ../../c-api/init.rst:1267
+#: ../../c-api/init.rst:1276
msgid ""
"This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it "
-"contains a closing brace; it must be matched with an earlier :c:macro:"
-"`Py_BEGIN_ALLOW_THREADS` macro. See above for further discussion of this "
-"macro."
+"contains a closing brace; it must be matched with an "
+"earlier :c:macro:`Py_BEGIN_ALLOW_THREADS` macro. See above for further "
+"discussion of this macro."
msgstr ""
-#: ../../c-api/init.rst:1275
+#: ../../c-api/init.rst:1284
msgid ""
-"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :"
-"c:macro:`Py_END_ALLOW_THREADS` without the closing brace."
+"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent "
+"to :c:macro:`Py_END_ALLOW_THREADS` without the closing brace."
msgstr ""
-#: ../../c-api/init.rst:1281
+#: ../../c-api/init.rst:1290
msgid ""
-"This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :"
-"c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable "
+"This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent "
+"to :c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable "
"declaration."
msgstr ""
-#: ../../c-api/init.rst:1287
+#: ../../c-api/init.rst:1296
msgid "Low-level API"
msgstr "低階 API"
-#: ../../c-api/init.rst:1289
+#: ../../c-api/init.rst:1298
msgid ""
"All of the following functions must be called after :c:func:`Py_Initialize`."
msgstr ""
-#: ../../c-api/init.rst:1291
+#: ../../c-api/init.rst:1300
msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`."
msgstr ""
-#: ../../c-api/init.rst:1297
+#: ../../c-api/init.rst:1306
msgid ""
"Create a new interpreter state object. The global interpreter lock need not "
"be held, but may be held if it is necessary to serialize calls to this "
"function."
msgstr ""
-#: ../../c-api/init.rst:1301
+#: ../../c-api/init.rst:1310
msgid ""
-"Raises an :ref:`auditing event ` ``cpython."
-"PyInterpreterState_New`` with no arguments."
+"Raises an :ref:`auditing event ` "
+"``cpython.PyInterpreterState_New`` with no arguments."
msgstr ""
-"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython."
-"PyInterpreterState_New``。"
+"引發一個不附帶引數的\\ :ref:`稽核事件 ` "
+"``cpython.PyInterpreterState_New``。"
-#: ../../c-api/init.rst:1306
+#: ../../c-api/init.rst:1315
msgid ""
"Reset all information in an interpreter state object. The global "
"interpreter lock must be held."
msgstr ""
-#: ../../c-api/init.rst:1309
+#: ../../c-api/init.rst:1318
msgid ""
-"Raises an :ref:`auditing event ` ``cpython."
-"PyInterpreterState_Clear`` with no arguments."
+"Raises an :ref:`auditing event ` "
+"``cpython.PyInterpreterState_Clear`` with no arguments."
msgstr ""
-"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython."
-"PyInterpreterState_Clear``。"
+"引發一個不附帶引數的\\ :ref:`稽核事件 ` "
+"``cpython.PyInterpreterState_Clear``。"
-#: ../../c-api/init.rst:1314
+#: ../../c-api/init.rst:1323
msgid ""
"Destroy an interpreter state object. The global interpreter lock need not "
"be held. The interpreter state must have been reset with a previous call "
"to :c:func:`PyInterpreterState_Clear`."
msgstr ""
-#: ../../c-api/init.rst:1321
+#: ../../c-api/init.rst:1330
msgid ""
"Create a new thread state object belonging to the given interpreter object. "
"The global interpreter lock need not be held, but may be held if it is "
"necessary to serialize calls to this function."
msgstr ""
-#: ../../c-api/init.rst:1328
+#: ../../c-api/init.rst:1337
msgid ""
"Reset all information in a thread state object. The global interpreter lock "
"must be held."
msgstr ""
-#: ../../c-api/init.rst:1331
+#: ../../c-api/init.rst:1340
msgid ""
"This function now calls the :c:member:`PyThreadState.on_delete` callback. "
"Previously, that happened in :c:func:`PyThreadState_Delete`."
msgstr ""
-#: ../../c-api/init.rst:1335
+#: ../../c-api/init.rst:1344
msgid "The :c:member:`PyThreadState.on_delete` callback was removed."
msgstr ":c:member:`PyThreadState.on_delete` 回呼已被移除。"
-#: ../../c-api/init.rst:1341
+#: ../../c-api/init.rst:1350
msgid ""
"Destroy a thread state object. The global interpreter lock need not be "
-"held. The thread state must have been reset with a previous call to :c:func:"
-"`PyThreadState_Clear`."
+"held. The thread state must have been reset with a previous call "
+"to :c:func:`PyThreadState_Clear`."
msgstr ""
-#: ../../c-api/init.rst:1348
+#: ../../c-api/init.rst:1357
msgid ""
"Destroy the current thread state and release the global interpreter lock. "
"Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be "
-"held. The thread state must have been reset with a previous call to :c:func:"
-"`PyThreadState_Clear`."
+"held. The thread state must have been reset with a previous call "
+"to :c:func:`PyThreadState_Clear`."
msgstr ""
-#: ../../c-api/init.rst:1356
+#: ../../c-api/init.rst:1365
msgid "Get the current frame of the Python thread state *tstate*."
msgstr ""
-#: ../../c-api/init.rst:1358
+#: ../../c-api/init.rst:1367
msgid ""
"Return a :term:`strong reference`. Return ``NULL`` if no frame is currently "
"executing."
msgstr ""
-#: ../../c-api/init.rst:1361
+#: ../../c-api/init.rst:1370
msgid "See also :c:func:`PyEval_GetFrame`."
msgstr "也請見 :c:func:`PyEval_GetFrame`。"
-#: ../../c-api/init.rst:1363 ../../c-api/init.rst:1372
-#: ../../c-api/init.rst:1381
+#: ../../c-api/init.rst:1372 ../../c-api/init.rst:1381
+#: ../../c-api/init.rst:1390
msgid "*tstate* must not be ``NULL``."
msgstr "*tstate* 不可為 ``NULL``。"
-#: ../../c-api/init.rst:1370
+#: ../../c-api/init.rst:1379
msgid ""
"Get the unique thread state identifier of the Python thread state *tstate*."
msgstr ""
-#: ../../c-api/init.rst:1379
+#: ../../c-api/init.rst:1388
msgid "Get the interpreter of the Python thread state *tstate*."
msgstr ""
-#: ../../c-api/init.rst:1388
+#: ../../c-api/init.rst:1397
msgid "Suspend tracing and profiling in the Python thread state *tstate*."
msgstr ""
-#: ../../c-api/init.rst:1390
+#: ../../c-api/init.rst:1399
msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function."
msgstr ""
-#: ../../c-api/init.rst:1397
+#: ../../c-api/init.rst:1406
msgid ""
"Resume tracing and profiling in the Python thread state *tstate* suspended "
"by the :c:func:`PyThreadState_EnterTracing` function."
msgstr ""
-#: ../../c-api/init.rst:1400
+#: ../../c-api/init.rst:1409
msgid ""
"See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions."
msgstr ""
-#: ../../c-api/init.rst:1408
+#: ../../c-api/init.rst:1417
msgid "Get the current interpreter."
msgstr ""
-#: ../../c-api/init.rst:1410
+#: ../../c-api/init.rst:1419
msgid ""
"Issue a fatal error if there no current Python thread state or no current "
"interpreter. It cannot return NULL."
msgstr ""
-#: ../../c-api/init.rst:1413 ../../c-api/init.rst:1423
+#: ../../c-api/init.rst:1422 ../../c-api/init.rst:1432
+#: ../../c-api/init.rst:1454
msgid "The caller must hold the GIL."
msgstr ""
-#: ../../c-api/init.rst:1420
+#: ../../c-api/init.rst:1429
msgid ""
"Return the interpreter's unique ID. If there was any error in doing so then "
"``-1`` is returned and an error is set."
msgstr ""
-#: ../../c-api/init.rst:1430
+#: ../../c-api/init.rst:1439
msgid ""
"Return a dictionary in which interpreter-specific data may be stored. If "
"this function returns ``NULL`` then no exception has been raised and the "
"caller should assume no interpreter-specific dict is available."
msgstr ""
-#: ../../c-api/init.rst:1434
+#: ../../c-api/init.rst:1443
msgid ""
"This is not a replacement for :c:func:`PyModule_GetState()`, which "
"extensions should use to store interpreter-specific state information."
msgstr ""
-#: ../../c-api/init.rst:1441
+#: ../../c-api/init.rst:1451
+msgid ""
+"Return a :term:`strong reference` to the ``__main__`` :ref:`module object "
+"` for the given interpreter."
+msgstr ""
+
+#: ../../c-api/init.rst:1461
msgid "Type of a frame evaluation function."
msgstr ""
-#: ../../c-api/init.rst:1443
+#: ../../c-api/init.rst:1463
msgid ""
"The *throwflag* parameter is used by the ``throw()`` method of generators: "
"if non-zero, handle the current exception."
msgstr ""
-#: ../../c-api/init.rst:1446
+#: ../../c-api/init.rst:1466
msgid "The function now takes a *tstate* parameter."
msgstr ""
-#: ../../c-api/init.rst:1449
+#: ../../c-api/init.rst:1469
msgid ""
"The *frame* parameter changed from ``PyFrameObject*`` to "
"``_PyInterpreterFrame*``."
msgstr ""
-#: ../../c-api/init.rst:1454
+#: ../../c-api/init.rst:1474
msgid "Get the frame evaluation function."
msgstr ""
-#: ../../c-api/init.rst:1456 ../../c-api/init.rst:1464
+#: ../../c-api/init.rst:1476 ../../c-api/init.rst:1484
msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"."
msgstr ""
-#: ../../c-api/init.rst:1462
+#: ../../c-api/init.rst:1482
msgid "Set the frame evaluation function."
msgstr ""
-#: ../../c-api/init.rst:1471
+#: ../../c-api/init.rst:1491
msgid ""
"Return a dictionary in which extensions can store thread-specific state "
"information. Each extension should use a unique key to use to store state "
@@ -1789,7 +1810,7 @@ msgid ""
"raised and the caller should assume no current thread state is available."
msgstr ""
-#: ../../c-api/init.rst:1480
+#: ../../c-api/init.rst:1500
msgid ""
"Asynchronously raise an exception in a thread. The *id* argument is the "
"thread id of the target thread; *exc* is the exception object to be raised. "
@@ -1801,33 +1822,34 @@ msgid ""
"raises no exceptions."
msgstr ""
-#: ../../c-api/init.rst:1488
+#: ../../c-api/init.rst:1508
msgid ""
-"The type of the *id* parameter changed from :c:expr:`long` to :c:expr:"
-"`unsigned long`."
+"The type of the *id* parameter changed from :c:expr:`long` "
+"to :c:expr:`unsigned long`."
msgstr ""
-#: ../../c-api/init.rst:1494
+#: ../../c-api/init.rst:1514
msgid ""
"Acquire the global interpreter lock and set the current thread state to "
"*tstate*, which must not be ``NULL``. The lock must have been created "
"earlier. If this thread already has the lock, deadlock ensues."
msgstr ""
-#: ../../c-api/init.rst:1505
+#: ../../c-api/init.rst:1525
msgid ""
-"Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:"
-"`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the "
-"current thread if called while the interpreter is finalizing."
+"Updated to be consistent "
+"with :c:func:`PyEval_RestoreThread`, :c:func:`Py_END_ALLOW_THREADS`, "
+"and :c:func:`PyGILState_Ensure`, and terminate the current thread if called "
+"while the interpreter is finalizing."
msgstr ""
-#: ../../c-api/init.rst:1510
+#: ../../c-api/init.rst:1530
msgid ""
":c:func:`PyEval_RestoreThread` is a higher-level function which is always "
"available (even when threads have not been initialized)."
msgstr ""
-#: ../../c-api/init.rst:1516
+#: ../../c-api/init.rst:1536
msgid ""
"Reset the current thread state to ``NULL`` and release the global "
"interpreter lock. The lock must have been created earlier and must be held "
@@ -1836,17 +1858,17 @@ msgid ""
"isn't, a fatal error is reported."
msgstr ""
-#: ../../c-api/init.rst:1522
+#: ../../c-api/init.rst:1542
msgid ""
":c:func:`PyEval_SaveThread` is a higher-level function which is always "
"available (even when threads have not been initialized)."
msgstr ""
-#: ../../c-api/init.rst:1529
+#: ../../c-api/init.rst:1549
msgid "Sub-interpreter support"
msgstr ""
-#: ../../c-api/init.rst:1531
+#: ../../c-api/init.rst:1551
msgid ""
"While in most uses, you will only embed a single Python interpreter, there "
"are cases where you need to create several independent interpreters in the "
@@ -1854,7 +1876,7 @@ msgid ""
"to do that."
msgstr ""
-#: ../../c-api/init.rst:1536
+#: ../../c-api/init.rst:1556
msgid ""
"The \"main\" interpreter is the first one created when the runtime "
"initializes. It is usually the only Python interpreter in a process. Unlike "
@@ -1865,134 +1887,134 @@ msgid ""
"returns a pointer to its state."
msgstr ""
-#: ../../c-api/init.rst:1543
+#: ../../c-api/init.rst:1563
msgid ""
-"You can switch between sub-interpreters using the :c:func:"
-"`PyThreadState_Swap` function. You can create and destroy them using the "
-"following functions:"
+"You can switch between sub-interpreters using "
+"the :c:func:`PyThreadState_Swap` function. You can create and destroy them "
+"using the following functions:"
msgstr ""
-#: ../../c-api/init.rst:1549
+#: ../../c-api/init.rst:1569
msgid ""
"Structure containing most parameters to configure a sub-interpreter. Its "
"values are used only in :c:func:`Py_NewInterpreterFromConfig` and never "
"modified by the runtime."
msgstr ""
-#: ../../c-api/init.rst:1555
+#: ../../c-api/init.rst:1575
msgid "Structure fields:"
msgstr ""
-#: ../../c-api/init.rst:1559
+#: ../../c-api/init.rst:1579
msgid ""
"If this is ``0`` then the sub-interpreter will use its own \"object\" "
"allocator state. Otherwise it will use (share) the main interpreter's."
msgstr ""
-#: ../../c-api/init.rst:1563
+#: ../../c-api/init.rst:1583
msgid ""
-"If this is ``0`` then :c:member:`~PyInterpreterConfig."
-"check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` "
-"then :c:member:`~PyInterpreterConfig.gil` must not be :c:macro:"
-"`PyInterpreterConfig_OWN_GIL`."
+"If this is ``0`` "
+"then :c:member:`~PyInterpreterConfig.check_multi_interp_extensions` must be "
+"``1`` (non-zero). If this is ``1`` then :c:member:`~PyInterpreterConfig.gil` "
+"must not be :c:macro:`PyInterpreterConfig_OWN_GIL`."
msgstr ""
-#: ../../c-api/init.rst:1571
+#: ../../c-api/init.rst:1591
msgid ""
"If this is ``0`` then the runtime will not support forking the process in "
"any thread where the sub-interpreter is currently active. Otherwise fork is "
"unrestricted."
msgstr ""
-#: ../../c-api/init.rst:1575
+#: ../../c-api/init.rst:1595
msgid ""
"Note that the :mod:`subprocess` module still works when fork is disallowed."
msgstr ""
-#: ../../c-api/init.rst:1580
+#: ../../c-api/init.rst:1600
msgid ""
"If this is ``0`` then the runtime will not support replacing the current "
"process via exec (e.g. :func:`os.execv`) in any thread where the sub-"
"interpreter is currently active. Otherwise exec is unrestricted."
msgstr ""
-#: ../../c-api/init.rst:1585
+#: ../../c-api/init.rst:1605
msgid ""
"Note that the :mod:`subprocess` module still works when exec is disallowed."
msgstr ""
-#: ../../c-api/init.rst:1590
+#: ../../c-api/init.rst:1610
msgid ""
"If this is ``0`` then the sub-interpreter's :mod:`threading` module won't "
"create threads. Otherwise threads are allowed."
msgstr ""
-#: ../../c-api/init.rst:1596
+#: ../../c-api/init.rst:1616
msgid ""
"If this is ``0`` then the sub-interpreter's :mod:`threading` module won't "
-"create daemon threads. Otherwise daemon threads are allowed (as long as :c:"
-"member:`~PyInterpreterConfig.allow_threads` is non-zero)."
+"create daemon threads. Otherwise daemon threads are allowed (as long "
+"as :c:member:`~PyInterpreterConfig.allow_threads` is non-zero)."
msgstr ""
-#: ../../c-api/init.rst:1603
+#: ../../c-api/init.rst:1623
msgid ""
"If this is ``0`` then all extension modules may be imported, including "
"legacy (single-phase init) modules, in any thread where the sub-interpreter "
-"is currently active. Otherwise only multi-phase init extension modules (see :"
-"pep:`489`) may be imported. (Also see :c:macro:"
-"`Py_mod_multiple_interpreters`.)"
+"is currently active. Otherwise only multi-phase init extension modules "
+"(see :pep:`489`) may be imported. (Also "
+"see :c:macro:`Py_mod_multiple_interpreters`.)"
msgstr ""
-#: ../../c-api/init.rst:1610
+#: ../../c-api/init.rst:1630
msgid ""
-"This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig."
-"use_main_obmalloc` is ``0``."
+"This must be ``1`` (non-zero) "
+"if :c:member:`~PyInterpreterConfig.use_main_obmalloc` is ``0``."
msgstr ""
-#: ../../c-api/init.rst:1615
+#: ../../c-api/init.rst:1635
msgid ""
"This determines the operation of the GIL for the sub-interpreter. It may be "
"one of the following:"
msgstr ""
-#: ../../c-api/init.rst:1622
+#: ../../c-api/init.rst:1642
msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)."
msgstr ""
-#: ../../c-api/init.rst:1626
+#: ../../c-api/init.rst:1646
msgid "Use (share) the main interpreter's GIL."
msgstr ""
-#: ../../c-api/init.rst:1630
+#: ../../c-api/init.rst:1650
msgid "Use the sub-interpreter's own GIL."
msgstr ""
-#: ../../c-api/init.rst:1632
+#: ../../c-api/init.rst:1652
msgid ""
-"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:"
-"`PyInterpreterConfig.use_main_obmalloc` must be ``0``."
+"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` "
+"then :c:member:`PyInterpreterConfig.use_main_obmalloc` must be ``0``."
msgstr ""
-#: ../../c-api/init.rst:1646
+#: ../../c-api/init.rst:1666
msgid ""
"Create a new sub-interpreter. This is an (almost) totally separate "
"environment for the execution of Python code. In particular, the new "
"interpreter has separate, independent versions of all imported modules, "
-"including the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:"
-"`sys`. The table of loaded modules (``sys.modules``) and the module search "
-"path (``sys.path``) are also separate. The new environment has no ``sys."
-"argv`` variable. It has new standard I/O stream file objects ``sys.stdin``, "
-"``sys.stdout`` and ``sys.stderr`` (however these refer to the same "
-"underlying file descriptors)."
+"including the fundamental modules :mod:`builtins`, :mod:`__main__` "
+"and :mod:`sys`. The table of loaded modules (``sys.modules``) and the "
+"module search path (``sys.path``) are also separate. The new environment "
+"has no ``sys.argv`` variable. It has new standard I/O stream file objects "
+"``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` (however these refer to the "
+"same underlying file descriptors)."
msgstr ""
-#: ../../c-api/init.rst:1656
+#: ../../c-api/init.rst:1676
msgid ""
"The given *config* controls the options with which the interpreter is "
"initialized."
msgstr ""
-#: ../../c-api/init.rst:1659
+#: ../../c-api/init.rst:1679
msgid ""
"Upon success, *tstate_p* will be set to the first thread state created in "
"the new sub-interpreter. This thread state is made in the current thread "
@@ -2003,7 +2025,7 @@ msgid ""
"state."
msgstr ""
-#: ../../c-api/init.rst:1668
+#: ../../c-api/init.rst:1688
msgid ""
"Like all other Python/C API functions, the global interpreter lock must be "
"held before calling this function and is still held when it returns. "
@@ -2015,13 +2037,13 @@ msgid ""
"released here."
msgstr ""
-#: ../../c-api/init.rst:1679
+#: ../../c-api/init.rst:1699
msgid ""
"Sub-interpreters are most effective when isolated from each other, with "
"certain functionality restricted::"
msgstr ""
-#: ../../c-api/init.rst:1682
+#: ../../c-api/init.rst:1702
msgid ""
"PyInterpreterConfig config = {\n"
" .use_main_obmalloc = 0,\n"
@@ -2053,58 +2075,59 @@ msgstr ""
" Py_ExitStatusException(status);\n"
"}"
-#: ../../c-api/init.rst:1697
+#: ../../c-api/init.rst:1717
msgid ""
"Note that the config is used only briefly and does not get modified. During "
-"initialization the config's values are converted into various :c:type:"
-"`PyInterpreterState` values. A read-only copy of the config may be stored "
-"internally on the :c:type:`PyInterpreterState`."
+"initialization the config's values are converted into "
+"various :c:type:`PyInterpreterState` values. A read-only copy of the config "
+"may be stored internally on the :c:type:`PyInterpreterState`."
msgstr ""
-#: ../../c-api/init.rst:1706
+#: ../../c-api/init.rst:1726
msgid "Extension modules are shared between (sub-)interpreters as follows:"
msgstr ""
-#: ../../c-api/init.rst:1708
+#: ../../c-api/init.rst:1728
msgid ""
-"For modules using multi-phase initialization, e.g. :c:func:"
-"`PyModule_FromDefAndSpec`, a separate module object is created and "
-"initialized for each interpreter. Only C-level static and global variables "
-"are shared between these module objects."
+"For modules using multi-phase initialization, "
+"e.g. :c:func:`PyModule_FromDefAndSpec`, a separate module object is created "
+"and initialized for each interpreter. Only C-level static and global "
+"variables are shared between these module objects."
msgstr ""
-#: ../../c-api/init.rst:1714
+#: ../../c-api/init.rst:1734
msgid ""
-"For modules using single-phase initialization, e.g. :c:func:"
-"`PyModule_Create`, the first time a particular extension is imported, it is "
-"initialized normally, and a (shallow) copy of its module's dictionary is "
-"squirreled away. When the same extension is imported by another "
-"(sub-)interpreter, a new module is initialized and filled with the contents "
-"of this copy; the extension's ``init`` function is not called. Objects in "
-"the module's dictionary thus end up shared across (sub-)interpreters, which "
-"might cause unwanted behavior (see `Bugs and caveats`_ below)."
+"For modules using single-phase initialization, "
+"e.g. :c:func:`PyModule_Create`, the first time a particular extension is "
+"imported, it is initialized normally, and a (shallow) copy of its module's "
+"dictionary is squirreled away. When the same extension is imported by "
+"another (sub-)interpreter, a new module is initialized and filled with the "
+"contents of this copy; the extension's ``init`` function is not called. "
+"Objects in the module's dictionary thus end up shared across "
+"(sub-)interpreters, which might cause unwanted behavior (see `Bugs and "
+"caveats`_ below)."
msgstr ""
-#: ../../c-api/init.rst:1725
+#: ../../c-api/init.rst:1745
msgid ""
"Note that this is different from what happens when an extension is imported "
-"after the interpreter has been completely re-initialized by calling :c:func:"
-"`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, the extension's "
-"``initmodule`` function *is* called again. As with multi-phase "
-"initialization, this means that only C-level static and global variables are "
-"shared between these modules."
+"after the interpreter has been completely re-initialized by "
+"calling :c:func:`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, "
+"the extension's ``initmodule`` function *is* called again. As with multi-"
+"phase initialization, this means that only C-level static and global "
+"variables are shared between these modules."
msgstr ""
-#: ../../c-api/init.rst:1745
+#: ../../c-api/init.rst:1765
msgid ""
-"Create a new sub-interpreter. This is essentially just a wrapper around :c:"
-"func:`Py_NewInterpreterFromConfig` with a config that preserves the existing "
-"behavior. The result is an unisolated sub-interpreter that shares the main "
-"interpreter's GIL, allows fork/exec, allows daemon threads, and allows "
-"single-phase init modules."
+"Create a new sub-interpreter. This is essentially just a wrapper "
+"around :c:func:`Py_NewInterpreterFromConfig` with a config that preserves "
+"the existing behavior. The result is an unisolated sub-interpreter that "
+"shares the main interpreter's GIL, allows fork/exec, allows daemon threads, "
+"and allows single-phase init modules."
msgstr ""
-#: ../../c-api/init.rst:1757
+#: ../../c-api/init.rst:1777
msgid ""
"Destroy the (sub-)interpreter represented by the given thread state. The "
"given thread state must be the current thread state. See the discussion of "
@@ -2114,17 +2137,17 @@ msgid ""
"be held before calling this function. No GIL is held when it returns."
msgstr ""
-#: ../../c-api/init.rst:1765
+#: ../../c-api/init.rst:1785
msgid ""
":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been "
"explicitly destroyed at that point."
msgstr ""
-#: ../../c-api/init.rst:1770
+#: ../../c-api/init.rst:1790
msgid "A Per-Interpreter GIL"
-msgstr ""
+msgstr "直譯器各別持有的 GIL"
-#: ../../c-api/init.rst:1772
+#: ../../c-api/init.rst:1792
msgid ""
"Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter "
"that is completely isolated from other interpreters, including having its "
@@ -2136,7 +2159,7 @@ msgid ""
"just using threads. (See :pep:`554`.)"
msgstr ""
-#: ../../c-api/init.rst:1782
+#: ../../c-api/init.rst:1802
msgid ""
"Using an isolated interpreter requires vigilance in preserving that "
"isolation. That especially means not sharing any objects or mutable state "
@@ -2150,7 +2173,7 @@ msgid ""
"builtin objects."
msgstr ""
-#: ../../c-api/init.rst:1793
+#: ../../c-api/init.rst:1813
msgid ""
"If you preserve isolation then you will have access to proper multi-core "
"computing without the complications that come with free-threading. Failure "
@@ -2158,7 +2181,7 @@ msgid ""
"threading, including races and hard-to-debug crashes."
msgstr ""
-#: ../../c-api/init.rst:1798
+#: ../../c-api/init.rst:1818
msgid ""
"Aside from that, one of the main challenges of using multiple isolated "
"interpreters is how to communicate between them safely (not break isolation) "
@@ -2168,11 +2191,11 @@ msgid ""
"sharing) data between interpreters."
msgstr ""
-#: ../../c-api/init.rst:1809
+#: ../../c-api/init.rst:1829
msgid "Bugs and caveats"
msgstr ""
-#: ../../c-api/init.rst:1811
+#: ../../c-api/init.rst:1831
msgid ""
"Because sub-interpreters (and the main interpreter) are part of the same "
"process, the insulation between them isn't perfect --- for example, using "
@@ -2185,7 +2208,7 @@ msgid ""
"should be avoided if possible."
msgstr ""
-#: ../../c-api/init.rst:1821
+#: ../../c-api/init.rst:1841
msgid ""
"Special care should be taken to avoid sharing user-defined functions, "
"methods, instances or classes between sub-interpreters, since import "
@@ -2194,37 +2217,37 @@ msgid ""
"objects from which the above are reachable."
msgstr ""
-#: ../../c-api/init.rst:1827
+#: ../../c-api/init.rst:1847
msgid ""
"Also note that combining this functionality with ``PyGILState_*`` APIs is "
"delicate, because these APIs assume a bijection between Python thread states "
"and OS-level threads, an assumption broken by the presence of sub-"
"interpreters. It is highly recommended that you don't switch sub-"
-"interpreters between a pair of matching :c:func:`PyGILState_Ensure` and :c:"
-"func:`PyGILState_Release` calls. Furthermore, extensions (such as :mod:"
-"`ctypes`) using these APIs to allow calling of Python code from non-Python "
-"created threads will probably be broken when using sub-interpreters."
+"interpreters between a pair of matching :c:func:`PyGILState_Ensure` "
+"and :c:func:`PyGILState_Release` calls. Furthermore, extensions (such "
+"as :mod:`ctypes`) using these APIs to allow calling of Python code from non-"
+"Python created threads will probably be broken when using sub-interpreters."
msgstr ""
-#: ../../c-api/init.rst:1838
+#: ../../c-api/init.rst:1858
msgid "Asynchronous Notifications"
msgstr ""
-#: ../../c-api/init.rst:1840
+#: ../../c-api/init.rst:1860
msgid ""
"A mechanism is provided to make asynchronous notifications to the main "
"interpreter thread. These notifications take the form of a function pointer "
"and a void pointer argument."
msgstr ""
-#: ../../c-api/init.rst:1847
+#: ../../c-api/init.rst:1867
msgid ""
"Schedule a function to be called from the main interpreter thread. On "
"success, ``0`` is returned and *func* is queued for being called in the main "
"thread. On failure, ``-1`` is returned without setting any exception."
msgstr ""
-#: ../../c-api/init.rst:1851
+#: ../../c-api/init.rst:1871
msgid ""
"When successfully queued, *func* will be *eventually* called from the main "
"interpreter thread with the argument *arg*. It will be called "
@@ -2232,17 +2255,17 @@ msgid ""
"these conditions met:"
msgstr ""
-#: ../../c-api/init.rst:1856
+#: ../../c-api/init.rst:1876
msgid "on a :term:`bytecode` boundary;"
msgstr ""
-#: ../../c-api/init.rst:1857
+#: ../../c-api/init.rst:1877
msgid ""
"with the main thread holding the :term:`global interpreter lock` (*func* can "
"therefore use the full C API)."
msgstr ""
-#: ../../c-api/init.rst:1860
+#: ../../c-api/init.rst:1880
msgid ""
"*func* must return ``0`` on success, or ``-1`` on failure with an exception "
"set. *func* won't be interrupted to perform another asynchronous "
@@ -2250,30 +2273,30 @@ msgid ""
"if the global interpreter lock is released."
msgstr ""
-#: ../../c-api/init.rst:1865
+#: ../../c-api/init.rst:1885
msgid ""
"This function doesn't need a current thread state to run, and it doesn't "
"need the global interpreter lock."
msgstr ""
-#: ../../c-api/init.rst:1868
+#: ../../c-api/init.rst:1888
msgid ""
"To call this function in a subinterpreter, the caller must hold the GIL. "
"Otherwise, the function *func* can be scheduled to be called from the wrong "
"interpreter."
msgstr ""
-#: ../../c-api/init.rst:1873
+#: ../../c-api/init.rst:1893
msgid ""
"This is a low-level function, only useful for very special cases. There is "
"no guarantee that *func* will be called as quick as possible. If the main "
"thread is busy executing a system call, *func* won't be called before the "
"system call returns. This function is generally **not** suitable for "
-"calling Python code from arbitrary C threads. Instead, use the :ref:"
-"`PyGILState API`."
+"calling Python code from arbitrary C threads. Instead, use "
+"the :ref:`PyGILState API`."
msgstr ""
-#: ../../c-api/init.rst:1882
+#: ../../c-api/init.rst:1902
msgid ""
"If this function is called in a subinterpreter, the function *func* is now "
"scheduled to be called from the subinterpreter, rather than being called "
@@ -2281,18 +2304,18 @@ msgid ""
"scheduled calls."
msgstr ""
-#: ../../c-api/init.rst:1891
+#: ../../c-api/init.rst:1911
msgid "Profiling and Tracing"
msgstr ""
-#: ../../c-api/init.rst:1896
+#: ../../c-api/init.rst:1916
msgid ""
"The Python interpreter provides some low-level support for attaching "
"profiling and execution tracing facilities. These are used for profiling, "
"debugging, and coverage analysis tools."
msgstr ""
-#: ../../c-api/init.rst:1900
+#: ../../c-api/init.rst:1920
msgid ""
"This C interface allows the profiling or tracing code to avoid the overhead "
"of calling through Python-level callable objects, making a direct C function "
@@ -2302,78 +2325,76 @@ msgid ""
"reported to the Python-level trace functions in previous versions."
msgstr ""
-#: ../../c-api/init.rst:1910
+#: ../../c-api/init.rst:1930
msgid ""
"The type of the trace function registered using :c:func:`PyEval_SetProfile` "
"and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to "
"the registration function as *obj*, *frame* is the frame object to which the "
-"event pertains, *what* is one of the constants :c:data:`PyTrace_CALL`, :c:"
-"data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :"
-"c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:"
-"`PyTrace_C_RETURN`, or :c:data:`PyTrace_OPCODE`, and *arg* depends on the "
-"value of *what*:"
+"event pertains, *what* is one of the "
+"constants :c:data:`PyTrace_CALL`, :c:data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:`PyTrace_C_RETURN`, "
+"or :c:data:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:"
msgstr ""
-#: ../../c-api/init.rst:1919
+#: ../../c-api/init.rst:1939
msgid "Value of *what*"
msgstr ""
-#: ../../c-api/init.rst:1919
+#: ../../c-api/init.rst:1939
msgid "Meaning of *arg*"
msgstr "*arg* 的含義"
-#: ../../c-api/init.rst:1921
+#: ../../c-api/init.rst:1941
msgid ":c:data:`PyTrace_CALL`"
msgstr ":c:data:`PyTrace_CALL`"
-#: ../../c-api/init.rst:1921 ../../c-api/init.rst:1926
-#: ../../c-api/init.rst:1937
+#: ../../c-api/init.rst:1941 ../../c-api/init.rst:1946
+#: ../../c-api/init.rst:1957
msgid "Always :c:data:`Py_None`."
msgstr ""
-#: ../../c-api/init.rst:1923
+#: ../../c-api/init.rst:1943
msgid ":c:data:`PyTrace_EXCEPTION`"
msgstr ":c:data:`PyTrace_EXCEPTION`"
-#: ../../c-api/init.rst:1923
+#: ../../c-api/init.rst:1943
msgid "Exception information as returned by :func:`sys.exc_info`."
msgstr ""
-#: ../../c-api/init.rst:1926
+#: ../../c-api/init.rst:1946
msgid ":c:data:`PyTrace_LINE`"
msgstr ":c:data:`PyTrace_LINE`"
-#: ../../c-api/init.rst:1928
+#: ../../c-api/init.rst:1948
msgid ":c:data:`PyTrace_RETURN`"
msgstr ":c:data:`PyTrace_RETURN`"
-#: ../../c-api/init.rst:1928
+#: ../../c-api/init.rst:1948
msgid ""
"Value being returned to the caller, or ``NULL`` if caused by an exception."
msgstr ""
-#: ../../c-api/init.rst:1931
+#: ../../c-api/init.rst:1951
msgid ":c:data:`PyTrace_C_CALL`"
msgstr ":c:data:`PyTrace_C_CALL`"
-#: ../../c-api/init.rst:1931 ../../c-api/init.rst:1933
-#: ../../c-api/init.rst:1935
+#: ../../c-api/init.rst:1951 ../../c-api/init.rst:1953
+#: ../../c-api/init.rst:1955
msgid "Function object being called."
msgstr "被呼叫的函式物件。"
-#: ../../c-api/init.rst:1933
+#: ../../c-api/init.rst:1953
msgid ":c:data:`PyTrace_C_EXCEPTION`"
msgstr ":c:data:`PyTrace_C_EXCEPTION`"
-#: ../../c-api/init.rst:1935
+#: ../../c-api/init.rst:1955
msgid ":c:data:`PyTrace_C_RETURN`"
msgstr ":c:data:`PyTrace_C_RETURN`"
-#: ../../c-api/init.rst:1937
+#: ../../c-api/init.rst:1957
msgid ":c:data:`PyTrace_OPCODE`"
msgstr ":c:data:`PyTrace_OPCODE`"
-#: ../../c-api/init.rst:1942
+#: ../../c-api/init.rst:1962
msgid ""
"The value of the *what* parameter to a :c:type:`Py_tracefunc` function when "
"a new call to a function or method is being reported, or a new entry into a "
@@ -2382,7 +2403,7 @@ msgid ""
"the corresponding frame."
msgstr ""
-#: ../../c-api/init.rst:1951
+#: ../../c-api/init.rst:1971
msgid ""
"The value of the *what* parameter to a :c:type:`Py_tracefunc` function when "
"an exception has been raised. The callback function is called with this "
@@ -2394,133 +2415,134 @@ msgid ""
"profiler."
msgstr ""
-#: ../../c-api/init.rst:1962
+#: ../../c-api/init.rst:1982
msgid ""
"The value passed as the *what* parameter to a :c:type:`Py_tracefunc` "
"function (but not a profiling function) when a line-number event is being "
-"reported. It may be disabled for a frame by setting :attr:`~frame."
-"f_trace_lines` to *0* on that frame."
+"reported. It may be disabled for a frame by "
+"setting :attr:`~frame.f_trace_lines` to *0* on that frame."
msgstr ""
-#: ../../c-api/init.rst:1970
+#: ../../c-api/init.rst:1990
msgid ""
"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when "
"a call is about to return."
msgstr ""
-#: ../../c-api/init.rst:1976
+#: ../../c-api/init.rst:1996
msgid ""
"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when "
"a C function is about to be called."
msgstr ""
-#: ../../c-api/init.rst:1982
+#: ../../c-api/init.rst:2002
msgid ""
"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when "
"a C function has raised an exception."
msgstr ""
-#: ../../c-api/init.rst:1988
+#: ../../c-api/init.rst:2008
msgid ""
"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when "
"a C function has returned."
msgstr ""
-#: ../../c-api/init.rst:1994
+#: ../../c-api/init.rst:2014
msgid ""
"The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but "
"not profiling functions) when a new opcode is about to be executed. This "
-"event is not emitted by default: it must be explicitly requested by setting :"
-"attr:`~frame.f_trace_opcodes` to *1* on the frame."
+"event is not emitted by default: it must be explicitly requested by "
+"setting :attr:`~frame.f_trace_opcodes` to *1* on the frame."
msgstr ""
-#: ../../c-api/init.rst:2002
+#: ../../c-api/init.rst:2022
msgid ""
"Set the profiler function to *func*. The *obj* parameter is passed to the "
"function as its first parameter, and may be any Python object, or ``NULL``. "
"If the profile function needs to maintain state, using a different value for "
"*obj* for each thread provides a convenient and thread-safe place to store "
-"it. The profile function is called for all monitored events except :c:data:"
-"`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`."
+"it. The profile function is called for all monitored events "
+"except :c:data:`PyTrace_LINE` :c:data:`PyTrace_OPCODE` "
+"and :c:data:`PyTrace_EXCEPTION`."
msgstr ""
-#: ../../c-api/init.rst:2009
+#: ../../c-api/init.rst:2029
msgid "See also the :func:`sys.setprofile` function."
msgstr ""
-#: ../../c-api/init.rst:2011 ../../c-api/init.rst:2018
-#: ../../c-api/init.rst:2037 ../../c-api/init.rst:2044
+#: ../../c-api/init.rst:2031 ../../c-api/init.rst:2038
+#: ../../c-api/init.rst:2057 ../../c-api/init.rst:2064
msgid "The caller must hold the :term:`GIL`."
msgstr "呼叫者必須持有 :term:`GIL`。"
-#: ../../c-api/init.rst:2015
+#: ../../c-api/init.rst:2035
msgid ""
"Like :c:func:`PyEval_SetProfile` but sets the profile function in all "
"running threads belonging to the current interpreter instead of the setting "
"it only on the current thread."
msgstr ""
-#: ../../c-api/init.rst:2020
+#: ../../c-api/init.rst:2040
msgid ""
"As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised "
"while setting the profile functions in all threads."
msgstr ""
-#: ../../c-api/init.rst:2028
+#: ../../c-api/init.rst:2048
msgid ""
-"Set the tracing function to *func*. This is similar to :c:func:"
-"`PyEval_SetProfile`, except the tracing function does receive line-number "
-"events and per-opcode events, but does not receive any event related to C "
-"function objects being called. Any trace function registered using :c:func:"
-"`PyEval_SetTrace` will not receive :c:data:`PyTrace_C_CALL`, :c:data:"
-"`PyTrace_C_EXCEPTION` or :c:data:`PyTrace_C_RETURN` as a value for the "
-"*what* parameter."
+"Set the tracing function to *func*. This is similar "
+"to :c:func:`PyEval_SetProfile`, except the tracing function does receive "
+"line-number events and per-opcode events, but does not receive any event "
+"related to C function objects being called. Any trace function registered "
+"using :c:func:`PyEval_SetTrace` will not "
+"receive :c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION` "
+"or :c:data:`PyTrace_C_RETURN` as a value for the *what* parameter."
msgstr ""
-#: ../../c-api/init.rst:2035
+#: ../../c-api/init.rst:2055
msgid "See also the :func:`sys.settrace` function."
msgstr "也請見 :func:`sys.settrace` 函式。"
-#: ../../c-api/init.rst:2041
+#: ../../c-api/init.rst:2061
msgid ""
"Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running "
"threads belonging to the current interpreter instead of the setting it only "
"on the current thread."
msgstr ""
-#: ../../c-api/init.rst:2046
+#: ../../c-api/init.rst:2066
msgid ""
"As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised "
"while setting the trace functions in all threads."
msgstr ""
-#: ../../c-api/init.rst:2052
+#: ../../c-api/init.rst:2072
msgid "Reference tracing"
msgstr ""
-#: ../../c-api/init.rst:2058
+#: ../../c-api/init.rst:2078
msgid ""
-"The type of the trace function registered using :c:func:"
-"`PyRefTracer_SetTracer`. The first parameter is a Python object that has "
-"been just created (when **event** is set to :c:data:`PyRefTracer_CREATE`) or "
-"about to be destroyed (when **event** is set to :c:data:"
-"`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer that was "
-"provided when :c:func:`PyRefTracer_SetTracer` was called."
+"The type of the trace function registered "
+"using :c:func:`PyRefTracer_SetTracer`. The first parameter is a Python "
+"object that has been just created (when **event** is set "
+"to :c:data:`PyRefTracer_CREATE`) or about to be destroyed (when **event** is "
+"set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque "
+"pointer that was provided when :c:func:`PyRefTracer_SetTracer` was called."
msgstr ""
-#: ../../c-api/init.rst:2068
+#: ../../c-api/init.rst:2088
msgid ""
"The value for the *event* parameter to :c:type:`PyRefTracer` functions when "
"a Python object has been created."
msgstr ""
-#: ../../c-api/init.rst:2073
+#: ../../c-api/init.rst:2093
msgid ""
"The value for the *event* parameter to :c:type:`PyRefTracer` functions when "
"a Python object has been destroyed."
msgstr ""
-#: ../../c-api/init.rst:2078
+#: ../../c-api/init.rst:2098
msgid ""
"Register a reference tracer function. The function will be called when a new "
"Python has been created or when an object is going to be destroyed. If "
@@ -2529,7 +2551,7 @@ msgid ""
"return ``-1`` on error."
msgstr ""
-#: ../../c-api/init.rst:2084
+#: ../../c-api/init.rst:2104
msgid ""
"Not that tracer functions **must not** create Python objects inside or "
"otherwise the call will be re-entrant. The tracer also **must not** clear "
@@ -2537,11 +2559,11 @@ msgid ""
"the tracer function is called."
msgstr ""
-#: ../../c-api/init.rst:2089 ../../c-api/init.rst:2100
+#: ../../c-api/init.rst:2109 ../../c-api/init.rst:2120
msgid "The GIL must be held when calling this function."
msgstr ""
-#: ../../c-api/init.rst:2095
+#: ../../c-api/init.rst:2115
msgid ""
"Get the registered reference tracer function and the value of the opaque "
"data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was "
@@ -2549,48 +2571,48 @@ msgid ""
"set the **data** pointer to NULL."
msgstr ""
-#: ../../c-api/init.rst:2107
+#: ../../c-api/init.rst:2127
msgid "Advanced Debugger Support"
msgstr ""
-#: ../../c-api/init.rst:2112
+#: ../../c-api/init.rst:2132
msgid ""
"These functions are only intended to be used by advanced debugging tools."
msgstr ""
-#: ../../c-api/init.rst:2117
+#: ../../c-api/init.rst:2137
msgid ""
"Return the interpreter state object at the head of the list of all such "
"objects."
msgstr ""
-#: ../../c-api/init.rst:2122
+#: ../../c-api/init.rst:2142
msgid "Return the main interpreter state object."
msgstr ""
-#: ../../c-api/init.rst:2127
+#: ../../c-api/init.rst:2147
msgid ""
"Return the next interpreter state object after *interp* from the list of all "
"such objects."
msgstr ""
-#: ../../c-api/init.rst:2133
+#: ../../c-api/init.rst:2153
msgid ""
"Return the pointer to the first :c:type:`PyThreadState` object in the list "
"of threads associated with the interpreter *interp*."
msgstr ""
-#: ../../c-api/init.rst:2139
+#: ../../c-api/init.rst:2159
msgid ""
"Return the next thread state object after *tstate* from the list of all such "
"objects belonging to the same :c:type:`PyInterpreterState` object."
msgstr ""
-#: ../../c-api/init.rst:2146
+#: ../../c-api/init.rst:2166
msgid "Thread Local Storage Support"
msgstr ""
-#: ../../c-api/init.rst:2150
+#: ../../c-api/init.rst:2170
msgid ""
"The Python interpreter provides low-level support for thread-local storage "
"(TLS) which wraps the underlying native TLS implementation to support the "
@@ -2600,42 +2622,42 @@ msgid ""
"thread."
msgstr ""
-#: ../../c-api/init.rst:2157
+#: ../../c-api/init.rst:2177
msgid ""
"The GIL does *not* need to be held when calling these functions; they supply "
"their own locking."
msgstr ""
-#: ../../c-api/init.rst:2160
+#: ../../c-api/init.rst:2180
msgid ""
"Note that :file:`Python.h` does not include the declaration of the TLS APIs, "
"you need to include :file:`pythread.h` to use thread-local storage."
msgstr ""
-#: ../../c-api/init.rst:2164
+#: ../../c-api/init.rst:2184
msgid ""
-"None of these API functions handle memory management on behalf of the :c:"
-"expr:`void*` values. You need to allocate and deallocate them yourself. If "
-"the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, these functions "
-"don't do refcount operations on them either."
+"None of these API functions handle memory management on behalf of "
+"the :c:expr:`void*` values. You need to allocate and deallocate them "
+"yourself. If the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, "
+"these functions don't do refcount operations on them either."
msgstr ""
-#: ../../c-api/init.rst:2172
+#: ../../c-api/init.rst:2192
msgid "Thread Specific Storage (TSS) API"
msgstr ""
-#: ../../c-api/init.rst:2174
+#: ../../c-api/init.rst:2194
msgid ""
"TSS API is introduced to supersede the use of the existing TLS API within "
"the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` "
"instead of :c:expr:`int` to represent thread keys."
msgstr ""
-#: ../../c-api/init.rst:2180
+#: ../../c-api/init.rst:2200
msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)"
msgstr ""
-#: ../../c-api/init.rst:2185
+#: ../../c-api/init.rst:2205
msgid ""
"This data structure represents the state of a thread key, the definition of "
"which may depend on the underlying TLS implementation, and it has an "
@@ -2643,66 +2665,67 @@ msgid ""
"public members in this structure."
msgstr ""
-#: ../../c-api/init.rst:2190
+#: ../../c-api/init.rst:2210
msgid ""
"When :ref:`Py_LIMITED_API ` is not defined, static allocation of "
"this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed."
msgstr ""
-#: ../../c-api/init.rst:2196
+#: ../../c-api/init.rst:2216
msgid ""
"This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note "
"that this macro won't be defined with :ref:`Py_LIMITED_API `."
msgstr ""
-#: ../../c-api/init.rst:2201
+#: ../../c-api/init.rst:2221
msgid "Dynamic Allocation"
msgstr ""
-#: ../../c-api/init.rst:2203
+#: ../../c-api/init.rst:2223
msgid ""
"Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules "
"built with :ref:`Py_LIMITED_API `, where static allocation of this "
"type is not possible due to its implementation being opaque at build time."
msgstr ""
-#: ../../c-api/init.rst:2210
+#: ../../c-api/init.rst:2230
msgid ""
-"Return a value which is the same state as a value initialized with :c:macro:"
-"`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure."
+"Return a value which is the same state as a value initialized "
+"with :c:macro:`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic "
+"allocation failure."
msgstr ""
-#: ../../c-api/init.rst:2217
+#: ../../c-api/init.rst:2237
msgid ""
"Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first "
"calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals "
"have been unassigned. This is a no-op if the *key* argument is ``NULL``."
msgstr ""
-#: ../../c-api/init.rst:2223
+#: ../../c-api/init.rst:2243
msgid ""
"A freed key becomes a dangling pointer. You should reset the key to ``NULL``."
msgstr ""
-#: ../../c-api/init.rst:2228
+#: ../../c-api/init.rst:2248
msgid "Methods"
msgstr "方法"
-#: ../../c-api/init.rst:2230
+#: ../../c-api/init.rst:2250
msgid ""
"The parameter *key* of these functions must not be ``NULL``. Moreover, the "
"behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are "
-"undefined if the given :c:type:`Py_tss_t` has not been initialized by :c:"
-"func:`PyThread_tss_create`."
+"undefined if the given :c:type:`Py_tss_t` has not been initialized "
+"by :c:func:`PyThread_tss_create`."
msgstr ""
-#: ../../c-api/init.rst:2238
+#: ../../c-api/init.rst:2258
msgid ""
"Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized "
"by :c:func:`PyThread_tss_create`."
msgstr ""
-#: ../../c-api/init.rst:2244
+#: ../../c-api/init.rst:2264
msgid ""
"Return a zero value on successful initialization of a TSS key. The behavior "
"is undefined if the value pointed to by the *key* argument is not "
@@ -2711,40 +2734,40 @@ msgid ""
"no-op and immediately returns success."
msgstr ""
-#: ../../c-api/init.rst:2253
+#: ../../c-api/init.rst:2273
msgid ""
"Destroy a TSS key to forget the values associated with the key across all "
"threads, and change the key's initialization state to uninitialized. A "
-"destroyed key is able to be initialized again by :c:func:"
-"`PyThread_tss_create`. This function can be called repeatedly on the same "
-"key -- calling it on an already destroyed key is a no-op."
+"destroyed key is able to be initialized again "
+"by :c:func:`PyThread_tss_create`. This function can be called repeatedly on "
+"the same key -- calling it on an already destroyed key is a no-op."
msgstr ""
-#: ../../c-api/init.rst:2262
+#: ../../c-api/init.rst:2282
msgid ""
"Return a zero value to indicate successfully associating a :c:expr:`void*` "
"value with a TSS key in the current thread. Each thread has a distinct "
"mapping of the key to a :c:expr:`void*` value."
msgstr ""
-#: ../../c-api/init.rst:2269
+#: ../../c-api/init.rst:2289
msgid ""
"Return the :c:expr:`void*` value associated with a TSS key in the current "
"thread. This returns ``NULL`` if no value is associated with the key in the "
"current thread."
msgstr ""
-#: ../../c-api/init.rst:2277
+#: ../../c-api/init.rst:2297
msgid "Thread Local Storage (TLS) API"
msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:"
-#: ../../c-api/init.rst:2279
+#: ../../c-api/init.rst:2299
msgid ""
"This API is superseded by :ref:`Thread Specific Storage (TSS) API `."
msgstr ""
-#: ../../c-api/init.rst:2284
+#: ../../c-api/init.rst:2304
msgid ""
"This version of the API does not support platforms where the native TLS key "
"is defined in a way that cannot be safely cast to ``int``. On such "
@@ -2753,62 +2776,62 @@ msgid ""
"platforms."
msgstr ""
-#: ../../c-api/init.rst:2289
+#: ../../c-api/init.rst:2309
msgid ""
"Due to the compatibility problem noted above, this version of the API should "
"not be used in new code."
msgstr ""
-#: ../../c-api/init.rst:2300
+#: ../../c-api/init.rst:2320
msgid "Synchronization Primitives"
msgstr ""
-#: ../../c-api/init.rst:2302
+#: ../../c-api/init.rst:2322
msgid "The C-API provides a basic mutual exclusion lock."
msgstr ""
-#: ../../c-api/init.rst:2306
+#: ../../c-api/init.rst:2326
msgid ""
"A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to "
"zero to represent the unlocked state. For example::"
msgstr ""
-#: ../../c-api/init.rst:2309
+#: ../../c-api/init.rst:2329
msgid "PyMutex mutex = {0};"
msgstr ""
-#: ../../c-api/init.rst:2311
+#: ../../c-api/init.rst:2331
msgid ""
"Instances of :c:type:`!PyMutex` should not be copied or moved. Both the "
"contents and address of a :c:type:`!PyMutex` are meaningful, and it must "
"remain at a fixed, writable location in memory."
msgstr ""
-#: ../../c-api/init.rst:2317
+#: ../../c-api/init.rst:2337
msgid ""
"A :c:type:`!PyMutex` currently occupies one byte, but the size should be "
"considered unstable. The size may change in future Python releases without "
"a deprecation period."
msgstr ""
-#: ../../c-api/init.rst:2325
+#: ../../c-api/init.rst:2345
msgid ""
"Lock mutex *m*. If another thread has already locked it, the calling thread "
"will block until the mutex is unlocked. While blocked, the thread will "
"temporarily release the :term:`GIL` if it is held."
msgstr ""
-#: ../../c-api/init.rst:2333
+#: ../../c-api/init.rst:2353
msgid ""
"Unlock mutex *m*. The mutex must be locked --- otherwise, the function will "
"issue a fatal error."
msgstr ""
-#: ../../c-api/init.rst:2341
+#: ../../c-api/init.rst:2361
msgid "Python Critical Section API"
msgstr ""
-#: ../../c-api/init.rst:2343
+#: ../../c-api/init.rst:2363
msgid ""
"The critical section API provides a deadlock avoidance layer on top of per-"
"object locks for :term:`free-threaded ` CPython. They are "
@@ -2816,17 +2839,18 @@ msgid ""
"no-ops in versions of Python with the global interpreter lock."
msgstr ""
-#: ../../c-api/init.rst:2348
+#: ../../c-api/init.rst:2368
msgid ""
"Critical sections avoid deadlocks by implicitly suspending active critical "
-"sections and releasing the locks during calls to :c:func:"
-"`PyEval_SaveThread`. When :c:func:`PyEval_RestoreThread` is called, the most "
-"recent critical section is resumed, and its locks reacquired. This means "
-"the critical section API provides weaker guarantees than traditional locks "
-"-- they are useful because their behavior is similar to the :term:`GIL`."
+"sections and releasing the locks during calls "
+"to :c:func:`PyEval_SaveThread`. When :c:func:`PyEval_RestoreThread` is "
+"called, the most recent critical section is resumed, and its locks "
+"reacquired. This means the critical section API provides weaker guarantees "
+"than traditional locks -- they are useful because their behavior is similar "
+"to the :term:`GIL`."
msgstr ""
-#: ../../c-api/init.rst:2355
+#: ../../c-api/init.rst:2375
msgid ""
"The functions and structs used by the macros are exposed for cases where C "
"macros are not available. They should only be used as in the given macro "
@@ -2834,20 +2858,20 @@ msgid ""
"future Python versions."
msgstr ""
-#: ../../c-api/init.rst:2362
+#: ../../c-api/init.rst:2382
msgid ""
-"Operations that need to lock two objects at once must use :c:macro:"
-"`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to "
-"lock more than one object at once, because the inner critical section may "
-"suspend the outer critical sections. This API does not provide a way to "
-"lock more than two objects at once."
+"Operations that need to lock two objects at once must "
+"use :c:macro:`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical "
+"sections to lock more than one object at once, because the inner critical "
+"section may suspend the outer critical sections. This API does not provide "
+"a way to lock more than two objects at once."
msgstr ""
-#: ../../c-api/init.rst:2368
+#: ../../c-api/init.rst:2388
msgid "Example usage::"
msgstr ""
-#: ../../c-api/init.rst:2370
+#: ../../c-api/init.rst:2390
msgid ""
"static PyObject *\n"
"set_field(MyObject *self, PyObject *value)\n"
@@ -2859,71 +2883,71 @@ msgid ""
"}"
msgstr ""
-#: ../../c-api/init.rst:2379
+#: ../../c-api/init.rst:2399
msgid ""
"In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which "
"can call arbitrary code through an object's deallocation function. The "
"critical section API avoids potential deadlocks due to reentrancy and lock "
"ordering by allowing the runtime to temporarily suspend the critical section "
-"if the code triggered by the finalizer blocks and calls :c:func:"
-"`PyEval_SaveThread`."
+"if the code triggered by the finalizer blocks and "
+"calls :c:func:`PyEval_SaveThread`."
msgstr ""
-#: ../../c-api/init.rst:2387
+#: ../../c-api/init.rst:2407
msgid ""
"Acquires the per-object lock for the object *op* and begins a critical "
"section."
msgstr ""
-#: ../../c-api/init.rst:2390 ../../c-api/init.rst:2404
-#: ../../c-api/init.rst:2419 ../../c-api/init.rst:2433
+#: ../../c-api/init.rst:2410 ../../c-api/init.rst:2424
+#: ../../c-api/init.rst:2439 ../../c-api/init.rst:2453
msgid "In the free-threaded build, this macro expands to::"
msgstr ""
-#: ../../c-api/init.rst:2392
+#: ../../c-api/init.rst:2412
msgid ""
"{\n"
" PyCriticalSection _py_cs;\n"
" PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))"
msgstr ""
-#: ../../c-api/init.rst:2396 ../../c-api/init.rst:2425
+#: ../../c-api/init.rst:2416 ../../c-api/init.rst:2445
msgid "In the default build, this macro expands to ``{``."
msgstr ""
-#: ../../c-api/init.rst:2402
+#: ../../c-api/init.rst:2422
msgid "Ends the critical section and releases the per-object lock."
msgstr ""
-#: ../../c-api/init.rst:2406
+#: ../../c-api/init.rst:2426
msgid ""
" PyCriticalSection_End(&_py_cs);\n"
"}"
msgstr ""
-#: ../../c-api/init.rst:2409 ../../c-api/init.rst:2438
+#: ../../c-api/init.rst:2429 ../../c-api/init.rst:2458
msgid "In the default build, this macro expands to ``}``."
msgstr ""
-#: ../../c-api/init.rst:2415
+#: ../../c-api/init.rst:2435
msgid ""
"Acquires the per-objects locks for the objects *a* and *b* and begins a "
"critical section. The locks are acquired in a consistent order (lowest "
"address first) to avoid lock ordering deadlocks."
msgstr ""
-#: ../../c-api/init.rst:2421
+#: ../../c-api/init.rst:2441
msgid ""
"{\n"
" PyCriticalSection2 _py_cs2;\n"
" PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))"
msgstr ""
-#: ../../c-api/init.rst:2431
+#: ../../c-api/init.rst:2451
msgid "Ends the critical section and releases the per-object locks."
msgstr ""
-#: ../../c-api/init.rst:2435
+#: ../../c-api/init.rst:2455
msgid ""
" PyCriticalSection2_End(&_py_cs2);\n"
"}"
@@ -2937,147 +2961,147 @@ msgstr "PyEval_InitThreads()"
msgid "modules (in module sys)"
msgstr "modules(sys 模組中)"
-#: ../../c-api/init.rst:350 ../../c-api/init.rst:701
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:710
msgid "path (in module sys)"
msgstr "path(sys 模組中)"
-#: ../../c-api/init.rst:350 ../../c-api/init.rst:701 ../../c-api/init.rst:1136
-#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:710 ../../c-api/init.rst:1145
+#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "module"
msgstr "模組"
-#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "builtins"
msgstr "builtins(內建)"
-#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "__main__"
msgstr "__main__"
-#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "sys"
msgstr "sys"
-#: ../../c-api/init.rst:350 ../../c-api/init.rst:701
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:710
msgid "search"
msgstr "search(搜尋)"
-#: ../../c-api/init.rst:350 ../../c-api/init.rst:701
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:710
msgid "path"
msgstr "path(路徑)"
-#: ../../c-api/init.rst:350 ../../c-api/init.rst:1702 ../../c-api/init.rst:1755
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:1722 ../../c-api/init.rst:1775
msgid "Py_FinalizeEx (C function)"
msgstr "Py_FinalizeEx(C 函式)"
-#: ../../c-api/init.rst:567
+#: ../../c-api/init.rst:576
msgid "Py_Initialize()"
msgstr "Py_Initialize()"
-#: ../../c-api/init.rst:567 ../../c-api/init.rst:799
+#: ../../c-api/init.rst:576 ../../c-api/init.rst:808
msgid "main()"
msgstr "main()"
-#: ../../c-api/init.rst:567
+#: ../../c-api/init.rst:576
msgid "Py_GetPath()"
msgstr "Py_GetPath()"
-#: ../../c-api/init.rst:680
+#: ../../c-api/init.rst:689
msgid "executable (in module sys)"
msgstr "executable(sys 模組中)"
-#: ../../c-api/init.rst:734 ../../c-api/init.rst:776 ../../c-api/init.rst:790
+#: ../../c-api/init.rst:743 ../../c-api/init.rst:785 ../../c-api/init.rst:799
msgid "version (in module sys)"
msgstr "version(sys 模組中)"
-#: ../../c-api/init.rst:746
+#: ../../c-api/init.rst:755
msgid "platform (in module sys)"
msgstr "platform(sys 模組中)"
-#: ../../c-api/init.rst:763
+#: ../../c-api/init.rst:772
msgid "copyright (in module sys)"
msgstr "copyright(sys 模組中)"
-#: ../../c-api/init.rst:799
+#: ../../c-api/init.rst:808
msgid "Py_FatalError()"
msgstr "Py_FatalError()"
-#: ../../c-api/init.rst:799
+#: ../../c-api/init.rst:808
msgid "argv (in module sys)"
msgstr "argv(sys 模組中)"
-#: ../../c-api/init.rst:919
+#: ../../c-api/init.rst:928
msgid "global interpreter lock"
msgstr "global interpreter lock(全域直譯器鎖)"
-#: ../../c-api/init.rst:919
+#: ../../c-api/init.rst:928
msgid "interpreter lock"
msgstr "interpreter lock(直譯器鎖)"
-#: ../../c-api/init.rst:919
+#: ../../c-api/init.rst:928
msgid "lock, interpreter"
msgstr "lock, interpreter(鎖、直譯器)"
-#: ../../c-api/init.rst:932
+#: ../../c-api/init.rst:941
msgid "setswitchinterval (in module sys)"
msgstr "setswitchinterval (sys 模組中)"
-#: ../../c-api/init.rst:941
+#: ../../c-api/init.rst:950
msgid "PyThreadState (C type)"
msgstr "PyThreadState(C 型別)"
-#: ../../c-api/init.rst:967
+#: ../../c-api/init.rst:976
msgid "Py_BEGIN_ALLOW_THREADS (C macro)"
msgstr "Py_BEGIN_ALLOW_THREADS(C 巨集)"
-#: ../../c-api/init.rst:967
+#: ../../c-api/init.rst:976
msgid "Py_END_ALLOW_THREADS (C macro)"
msgstr "Py_END_ALLOW_THREADS(C 巨集)"
-#: ../../c-api/init.rst:983
+#: ../../c-api/init.rst:992
msgid "PyEval_RestoreThread (C function)"
msgstr "PyEval_RestoreThread(C 函式)"
-#: ../../c-api/init.rst:983
+#: ../../c-api/init.rst:992
msgid "PyEval_SaveThread (C function)"
msgstr "PyEval_SaveThread(C 函式)"
-#: ../../c-api/init.rst:1114
+#: ../../c-api/init.rst:1123
msgid "PyEval_AcquireThread()"
msgstr "PyEval_AcquireThread()"
-#: ../../c-api/init.rst:1114
+#: ../../c-api/init.rst:1123
msgid "PyEval_ReleaseThread()"
msgstr "PyEval_ReleaseThread()"
-#: ../../c-api/init.rst:1114
+#: ../../c-api/init.rst:1123
msgid "PyEval_SaveThread()"
msgstr "PyEval_SaveThread()"
-#: ../../c-api/init.rst:1114
+#: ../../c-api/init.rst:1123
msgid "PyEval_RestoreThread()"
msgstr "PyEval_RestoreThread()"
-#: ../../c-api/init.rst:1136
+#: ../../c-api/init.rst:1145
msgid "_thread"
msgstr "_thread"
-#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737
+#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "stdout (in module sys)"
msgstr "stdout(sys 模組中)"
-#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737
+#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "stderr (in module sys)"
msgstr "stderr(sys 模組中)"
-#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737
+#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "stdin (in module sys)"
msgstr "stdin(sys 模組中)"
-#: ../../c-api/init.rst:1702
+#: ../../c-api/init.rst:1722
msgid "Py_Initialize (C function)"
msgstr "Py_Initialize(C 函式)"
-#: ../../c-api/init.rst:1732
+#: ../../c-api/init.rst:1752
msgid "close (in module os)"
msgstr "close(os 模組中)"
diff --git a/c-api/init_config.po b/c-api/init_config.po
index 5293b616d7..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-10-09 00:13+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-"
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 bfd8be22ed..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: 2024-10-10 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
@@ -584,18 +588,12 @@ msgid ""
"On success, return ``0``. On error, raise an exception and return ``-1``."
msgstr ""
-#: ../../c-api/module.rst:526
-msgid ""
-"Return ``-1`` if *value* is ``NULL``. It must be called with an exception "
-"raised in this case."
-msgstr ""
-
-#: ../../c-api/module.rst:529 ../../c-api/module.rst:576
-#: ../../c-api/module.rst:603
+#: ../../c-api/module.rst:526 ../../c-api/module.rst:577
+#: ../../c-api/module.rst:604
msgid "Example usage::"
msgstr "用法範例: ::"
-#: ../../c-api/module.rst:531
+#: ../../c-api/module.rst:528
msgid ""
"static int\n"
"add_spam(PyObject *module, int value)\n"
@@ -621,13 +619,20 @@ msgstr ""
" return res;\n"
" }"
-#: ../../c-api/module.rst:543
+#: ../../c-api/module.rst:540
+msgid ""
+"To be convenient, the function accepts ``NULL`` *value* with an exception "
+"set. In this case, return ``-1`` and just leave the raised exception "
+"unchanged."
+msgstr ""
+
+#: ../../c-api/module.rst:544
msgid ""
"The example can also be written without checking explicitly if *obj* is "
"``NULL``::"
msgstr ""
-#: ../../c-api/module.rst:546
+#: ../../c-api/module.rst:547
msgid ""
"static int\n"
"add_spam(PyObject *module, int value)\n"
@@ -647,23 +652,23 @@ msgstr ""
" return res;\n"
" }"
-#: ../../c-api/module.rst:555
+#: ../../c-api/module.rst:556
msgid ""
"Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this "
"case, since *obj* can be ``NULL``."
msgstr ""
-#: ../../c-api/module.rst:558
+#: ../../c-api/module.rst:559
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:571
+#: ../../c-api/module.rst:572
msgid ""
"Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to "
"*value*. It can be called with a result of function that returns a new "
@@ -671,39 +676,39 @@ msgid ""
"variable."
msgstr ""
-#: ../../c-api/module.rst:578
+#: ../../c-api/module.rst:579
msgid ""
"if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n"
" goto error;\n"
"}"
msgstr ""
-#: ../../c-api/module.rst:587
+#: ../../c-api/module.rst:588
msgid ""
"Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to "
"*value* on success (if it returns ``0``)."
msgstr ""
-#: ../../c-api/module.rst:590
+#: ../../c-api/module.rst:591
msgid ""
"The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions "
"are recommended, since it is easy to introduce reference leaks by misusing "
"the :c:func:`PyModule_AddObject` function."
msgstr ""
-#: ../../c-api/module.rst:597
+#: ../../c-api/module.rst:598
msgid ""
"Unlike other functions that steal references, ``PyModule_AddObject()`` only "
"releases the reference to *value* **on success**."
msgstr ""
-#: ../../c-api/module.rst:600
+#: ../../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:605
+#: ../../c-api/module.rst:606
msgid ""
"PyObject *obj = PyBytes_FromString(value);\n"
"if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n"
@@ -717,24 +722,24 @@ msgid ""
"// Py_XDECREF(obj) is not needed here."
msgstr ""
-#: ../../c-api/module.rst:618
+#: ../../c-api/module.rst:619
msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`."
msgstr ""
-#: ../../c-api/module.rst:623
+#: ../../c-api/module.rst:624
msgid ""
"Add an integer constant to *module* as *name*. This convenience function "
"can be used from the module's initialization function. Return ``-1`` with an "
"exception set on error, ``0`` on success."
msgstr ""
-#: ../../c-api/module.rst:627
+#: ../../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:633
+#: ../../c-api/module.rst:634
msgid ""
"Add a string constant to *module* as *name*. This convenience function can "
"be used from the module's initialization function. The string *value* must "
@@ -742,14 +747,14 @@ msgid ""
"on success."
msgstr ""
-#: ../../c-api/module.rst:638
+#: ../../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:645
+#: ../../c-api/module.rst:646
msgid ""
"Add an int constant to *module*. The name and the value are taken from "
"*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int "
@@ -757,11 +762,11 @@ msgid ""
"with an exception set on error, ``0`` on success."
msgstr ""
-#: ../../c-api/module.rst:653
+#: ../../c-api/module.rst:654
msgid "Add a string constant to *module*."
-msgstr ""
+msgstr "將字串常數加入到 *module* 中。"
-#: ../../c-api/module.rst:657
+#: ../../c-api/module.rst:658
msgid ""
"Add a type object to *module*. The type object is finalized by calling "
"internally :c:func:`PyType_Ready`. The name of the type object is taken from "
@@ -769,7 +774,7 @@ msgid ""
"``-1`` with an exception set on error, ``0`` on success."
msgstr ""
-#: ../../c-api/module.rst:667
+#: ../../c-api/module.rst:668
msgid ""
"Indicate that *module* does or does not support running without the global "
"interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. "
@@ -780,25 +785,25 @@ msgid ""
"Return ``-1`` with an exception set on error, ``0`` on success."
msgstr ""
-#: ../../c-api/module.rst:680
+#: ../../c-api/module.rst:681
msgid "Module lookup"
msgstr "模組查找"
-#: ../../c-api/module.rst:682
+#: ../../c-api/module.rst:683
msgid ""
"Single-phase initialization creates singleton modules that can be looked up "
"in the context of the current interpreter. This allows the module object to "
"be retrieved later with only a reference to the module definition."
msgstr ""
-#: ../../c-api/module.rst:686
+#: ../../c-api/module.rst:687
msgid ""
"These functions will not work on modules created using multi-phase "
"initialization, since multiple such modules can be created from a single "
"definition."
msgstr ""
-#: ../../c-api/module.rst:691
+#: ../../c-api/module.rst:692
msgid ""
"Returns the module object that was created from *def* for the current "
"interpreter. This method requires that the module object has been attached "
@@ -807,18 +812,18 @@ msgid ""
"to the interpreter state yet, it returns ``NULL``."
msgstr ""
-#: ../../c-api/module.rst:698
+#: ../../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:701
+#: ../../c-api/module.rst:702
msgid "Only effective on modules created using single-phase initialization."
msgstr ""
-#: ../../c-api/module.rst:703
+#: ../../c-api/module.rst:704
msgid ""
"Python calls ``PyState_AddModule`` automatically after importing a module, "
"so it is unnecessary (but harmless) to call it from module initialization "
@@ -829,15 +834,15 @@ msgid ""
"state updates)."
msgstr ""
-#: ../../c-api/module.rst:711 ../../c-api/module.rst:722
+#: ../../c-api/module.rst:712 ../../c-api/module.rst:723
msgid "The caller must hold the GIL."
msgstr ""
-#: ../../c-api/module.rst:713
+#: ../../c-api/module.rst:714
msgid "Return ``-1`` with an exception set on error, ``0`` on success."
msgstr "成功時回傳 ``0``,在失敗時回傳 ``-1`` 並設定例外。"
-#: ../../c-api/module.rst:719
+#: ../../c-api/module.rst:720
msgid ""
"Removes the module object created from *def* from the interpreter state. "
"Return ``-1`` with an exception set on error, ``0`` on success."
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 d557e3d5c6..85e8adfd09 100644
--- a/c-api/object.po
+++ b/c-api/object.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-27 00:14+0000\n"
+"POT-Creation-Date: 2025-01-05 00:15+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-"
@@ -28,23 +28,23 @@ 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"
-msgstr ""
+msgstr "常數識別字"
#: ../../c-api/object.rst:20
msgid "Value"
-msgstr ""
+msgstr "數值"
#: ../../c-api/object.rst:20
msgid "Returned object"
-msgstr ""
+msgstr "回傳物件"
#: ../../c-api/object.rst:22 ../../c-api/object.rst:27
msgid "``0``"
@@ -126,7 +126,7 @@ msgstr ""
#: ../../c-api/object.rst:42
msgid "In CPython, all of these constants are :term:`immortal`."
-msgstr ""
+msgstr "在 CPython 中,所有這些常數都是\\ :term:`不滅 `\\ 的。"
#: ../../c-api/object.rst:47
msgid ""
@@ -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,124 +196,128 @@ msgstr ""
#: ../../c-api/object.rst:113
msgid ""
-"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:"
-"`~object.__getattribute__` methods are silently ignored. 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:121
+#: ../../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:127
+#: ../../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 ""
-#: ../../c-api/object.rst:137
+#: ../../c-api/object.rst:138
msgid ""
"Retrieve an attribute named *attr_name* from object *o*. Returns the "
"attribute value on success, or ``NULL`` on failure. This is the equivalent "
"of the Python expression ``o.attr_name``."
msgstr ""
-#: ../../c-api/object.rst:141
+#: ../../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:147
+#: ../../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:151
+#: ../../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:157
+#: ../../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:160
+#: ../../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:172
+#: ../../c-api/object.rst:173
msgid ""
"This is the same as :c:func:`PyObject_GetOptionalAttr`, but *attr_name* is "
"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
"a :c:expr:`PyObject*`."
msgstr ""
-#: ../../c-api/object.rst:180
+#: ../../c-api/object.rst:181
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:190
+#: ../../c-api/object.rst:191
msgid ""
"Set the value of the attribute named *attr_name*, for object *o*, to the "
"value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on "
"success. This is the equivalent of the Python statement ``o.attr_name = v``."
msgstr ""
-#: ../../c-api/object.rst:195
+#: ../../c-api/object.rst:196
msgid ""
"If *v* is ``NULL``, the attribute is deleted. This behaviour is deprecated "
"in favour of using :c:func:`PyObject_DelAttr`, but there are currently no "
"plans to remove it."
msgstr ""
-#: ../../c-api/object.rst:202
+#: ../../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:206
+#: ../../c-api/object.rst:207
msgid ""
"If *v* is ``NULL``, the attribute is deleted, but this feature is deprecated "
"in favour of using :c:func:`PyObject_DelAttrString`."
msgstr ""
-#: ../../c-api/object.rst:209
+#: ../../c-api/object.rst:210
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:219
+#: ../../c-api/object.rst:220
msgid ""
"Generic attribute setter and deleter function that is meant to be put into a "
"type object's :c:member:`~PyTypeObject.tp_setattro` slot. It looks for a "
@@ -324,36 +329,36 @@ msgid ""
"returned."
msgstr ""
-#: ../../c-api/object.rst:231
+#: ../../c-api/object.rst:232
msgid ""
"Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on "
"failure. This is the equivalent of the Python statement ``del o.attr_name``."
msgstr ""
-#: ../../c-api/object.rst:237
+#: ../../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:241
+#: ../../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:252
+#: ../../c-api/object.rst:253
msgid ""
"A generic implementation for the getter of a ``__dict__`` descriptor. It "
"creates the dictionary if necessary."
msgstr ""
-#: ../../c-api/object.rst:255
+#: ../../c-api/object.rst:256
msgid ""
"This function may also be called to get the :py:attr:`~object.__dict__` of "
"the object *o*. Pass ``NULL`` for *context* when calling it. Since this "
@@ -362,67 +367,67 @@ msgid ""
"the object."
msgstr ""
-#: ../../c-api/object.rst:261
+#: ../../c-api/object.rst:262
msgid "On failure, returns ``NULL`` with an exception set."
msgstr "在失敗時,會回傳 ``NULL`` 並設定例外。"
-#: ../../c-api/object.rst:268
+#: ../../c-api/object.rst:269
msgid ""
"A generic implementation for the setter of a ``__dict__`` descriptor. This "
"implementation does not allow the dictionary to be deleted."
msgstr ""
-#: ../../c-api/object.rst:276
+#: ../../c-api/object.rst:277
msgid ""
"Return a pointer to :py:attr:`~object.__dict__` of the object *obj*. If "
"there is no ``__dict__``, return ``NULL`` without setting an exception."
msgstr ""
-#: ../../c-api/object.rst:279
+#: ../../c-api/object.rst:280
msgid ""
"This function may need to allocate memory for the dictionary, so it may be "
"more efficient to call :c:func:`PyObject_GetAttr` when accessing an "
"attribute on the object."
msgstr ""
-#: ../../c-api/object.rst:286
+#: ../../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:296
+#: ../../c-api/object.rst:297
msgid ""
"Compare the values of *o1* and *o2* using the operation specified by *opid*, "
"like :c:func:`PyObject_RichCompare`, but returns ``-1`` on error, ``0`` if "
"the result is false, ``1`` otherwise."
msgstr ""
-#: ../../c-api/object.rst:301
+#: ../../c-api/object.rst:302
msgid ""
"If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` "
"will always return ``1`` for :c:macro:`Py_EQ` and ``0`` for :c:macro:`Py_NE`."
msgstr ""
-#: ../../c-api/object.rst:306
+#: ../../c-api/object.rst:307
msgid ""
"Format *obj* using *format_spec*. This is equivalent to the Python "
"expression ``format(obj, format_spec)``."
msgstr ""
-#: ../../c-api/object.rst:309
+#: ../../c-api/object.rst:310
msgid ""
"*format_spec* may be ``NULL``. In this case the call is equivalent to "
"``format(obj)``. Returns the formatted string on success, ``NULL`` on "
"failure."
msgstr ""
-#: ../../c-api/object.rst:317
+#: ../../c-api/object.rst:318
msgid ""
"Compute a string representation of object *o*. Returns the string "
"representation on success, ``NULL`` on failure. This is the equivalent of "
@@ -430,22 +435,22 @@ msgid ""
"function."
msgstr ""
-#: ../../c-api/object.rst:321 ../../c-api/object.rst:345
+#: ../../c-api/object.rst:322 ../../c-api/object.rst:346
msgid ""
"This function now includes a debug assertion to help ensure that it does not "
"silently discard an active exception."
msgstr ""
-#: ../../c-api/object.rst:329
+#: ../../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:340
+#: ../../c-api/object.rst:341
msgid ""
"Compute a string representation of object *o*. Returns the string "
"representation on success, ``NULL`` on failure. This is the equivalent of "
@@ -453,7 +458,7 @@ msgid ""
"function and, therefore, by the :func:`print` function."
msgstr ""
-#: ../../c-api/object.rst:354
+#: ../../c-api/object.rst:355
msgid ""
"Compute a bytes representation of object *o*. ``NULL`` is returned on "
"failure and a bytes object on success. This is equivalent to the Python "
@@ -462,73 +467,73 @@ msgid ""
"bytes object."
msgstr ""
-#: ../../c-api/object.rst:363
+#: ../../c-api/object.rst:364
msgid ""
"Return ``1`` if the class *derived* is identical to or derived from the "
"class *cls*, otherwise return ``0``. In case of an error, return ``-1``."
msgstr ""
-#: ../../c-api/object.rst:366 ../../c-api/object.rst:385
+#: ../../c-api/object.rst:367 ../../c-api/object.rst:386
msgid ""
"If *cls* is a tuple, the check will be done against every entry in *cls*. "
"The result will be ``1`` when at least one of the checks returns ``1``, "
"otherwise it will be ``0``."
msgstr ""
-#: ../../c-api/object.rst:370
+#: ../../c-api/object.rst:371
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:375
+#: ../../c-api/object.rst:376
msgid ""
"Normally only class objects, i.e. instances of :class:`type` or a derived "
"class, are considered classes. However, objects can override this by having "
"a :attr:`~type.__bases__` attribute (which must be a tuple of base classes)."
msgstr ""
-#: ../../c-api/object.rst:382
+#: ../../c-api/object.rst:383
msgid ""
"Return ``1`` if *inst* is an instance of the class *cls* or a subclass of "
"*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception."
msgstr ""
-#: ../../c-api/object.rst:389
+#: ../../c-api/object.rst:390
msgid ""
"If *cls* has a :meth:`~type.__instancecheck__` method, it will be called to "
"determine the subclass status as described in :pep:`3119`. Otherwise, "
"*inst* is an instance of *cls* if its class is a subclass of *cls*."
msgstr ""
-#: ../../c-api/object.rst:393
+#: ../../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:396
+#: ../../c-api/object.rst:397
msgid ""
"An object *cls* can override if it is considered a class, and what its base "
"classes are, by having a :attr:`~type.__bases__` attribute (which must be a "
"tuple of base classes)."
msgstr ""
-#: ../../c-api/object.rst:405
+#: ../../c-api/object.rst:406
msgid ""
"Compute and return the hash value of an object *o*. On failure, return "
"``-1``. This is the equivalent of the Python expression ``hash(o)``."
msgstr ""
-#: ../../c-api/object.rst:408
+#: ../../c-api/object.rst:409
msgid ""
"The return type is now Py_hash_t. This is a signed integer the same size "
"as :c:type:`Py_ssize_t`."
msgstr ""
-#: ../../c-api/object.rst:415
+#: ../../c-api/object.rst:416
msgid ""
"Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` "
"and return ``-1``. This function receives special treatment when stored in a "
@@ -536,21 +541,21 @@ msgid ""
"that it is not hashable."
msgstr ""
-#: ../../c-api/object.rst:423
+#: ../../c-api/object.rst:424
msgid ""
"Returns ``1`` if the object *o* is considered to be true, and ``0`` "
"otherwise. This is equivalent to the Python expression ``not not o``. On "
"failure, return ``-1``."
msgstr ""
-#: ../../c-api/object.rst:430
+#: ../../c-api/object.rst:431
msgid ""
"Returns ``0`` if the object *o* is considered to be true, and ``1`` "
"otherwise. This is equivalent to the Python expression ``not o``. On "
"failure, return ``-1``."
msgstr ""
-#: ../../c-api/object.rst:439
+#: ../../c-api/object.rst:440
msgid ""
"When *o* is non-``NULL``, returns a type object corresponding to the object "
"type of object *o*. On failure, raises :exc:`SystemError` and returns "
@@ -561,13 +566,13 @@ msgid ""
"when a new :term:`strong reference` is needed."
msgstr ""
-#: ../../c-api/object.rst:451
+#: ../../c-api/object.rst:452
msgid ""
"Return non-zero if the object *o* is of type *type* or a subtype of *type*, "
"and ``0`` otherwise. Both parameters must be non-``NULL``."
msgstr ""
-#: ../../c-api/object.rst:460
+#: ../../c-api/object.rst:461
msgid ""
"Return the length of object *o*. If the object *o* provides either the "
"sequence and mapping protocols, the sequence length is returned. On error, "
@@ -575,7 +580,7 @@ msgid ""
"``len(o)``."
msgstr ""
-#: ../../c-api/object.rst:467
+#: ../../c-api/object.rst:468
msgid ""
"Return an estimated length for the object *o*. First try to return its "
"actual length, then an estimate using :meth:`~object.__length_hint__`, and "
@@ -584,36 +589,43 @@ msgid ""
"defaultvalue)``."
msgstr ""
-#: ../../c-api/object.rst:477
+#: ../../c-api/object.rst:478
msgid ""
"Return element of *o* corresponding to the object *key* or ``NULL`` on "
"failure. This is the equivalent of the Python expression ``o[key]``."
msgstr ""
-#: ../../c-api/object.rst:483
+#: ../../c-api/object.rst:484
msgid ""
"Map the object *key* to the value *v*. Raise an exception and return ``-1`` "
"on failure; return ``0`` on success. This is the equivalent of the Python "
"statement ``o[key] = v``. This function *does not* steal a reference to *v*."
msgstr ""
-#: ../../c-api/object.rst:491
+#: ../../c-api/object.rst:492
msgid ""
"Remove the mapping for the object *key* from the object *o*. Return ``-1`` "
"on failure. This is equivalent to the Python statement ``del o[key]``."
msgstr ""
-#: ../../c-api/object.rst:497
+#: ../../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*`."
+msgstr ""
+
+#: ../../c-api/object.rst:505
msgid ""
"This is equivalent to the Python expression ``dir(o)``, returning a "
"(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:506
+#: ../../c-api/object.rst:514
msgid ""
"This is equivalent to the Python expression ``iter(o)``. It returns a new "
"iterator for the object argument, or the object itself if the object is "
@@ -621,113 +633,122 @@ msgid ""
"object cannot be iterated."
msgstr ""
-#: ../../c-api/object.rst:514
+#: ../../c-api/object.rst:522
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 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."
msgstr ""
-#: ../../c-api/object.rst:524
+#: ../../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."
+msgstr ""
+
+#: ../../c-api/object.rst:538
msgid "Get a pointer to subclass-specific data reserved for *cls*."
msgstr ""
-#: ../../c-api/object.rst:526
+#: ../../c-api/object.rst:540
msgid ""
"The object *o* must be an instance of *cls*, and *cls* must have been "
"created using negative :c:member:`PyType_Spec.basicsize`. Python does not "
"check this."
msgstr ""
-#: ../../c-api/object.rst:530
+#: ../../c-api/object.rst:544
msgid "On error, set an exception and return ``NULL``."
-msgstr ""
+msgstr "錯誤時設定一個例外並回傳 ``NULL``。"
-#: ../../c-api/object.rst:536
+#: ../../c-api/object.rst:550
msgid ""
"Return the size of the instance memory space reserved for *cls*, i.e. the "
"size of the memory :c:func:`PyObject_GetTypeData` returns."
msgstr ""
-#: ../../c-api/object.rst:539
+#: ../../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:542
+#: ../../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:546
+#: ../../c-api/object.rst:560
msgid "On error, set an exception and return a negative value."
-msgstr ""
+msgstr "錯誤時設定一個例外並回傳一個負值。"
-#: ../../c-api/object.rst:552
+#: ../../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:555
+#: ../../c-api/object.rst:569
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:563
+#: ../../c-api/object.rst:577
msgid "Visit the managed dictionary of *obj*."
msgstr ""
-#: ../../c-api/object.rst:565 ../../c-api/object.rst:574
+#: ../../c-api/object.rst:579 ../../c-api/object.rst:588
msgid ""
"This function must only be called in a traverse function of the type which "
"has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set."
msgstr ""
-#: ../../c-api/object.rst:572
+#: ../../c-api/object.rst:586
msgid "Clear the managed dictionary of *obj*."
msgstr ""
-#: ../../c-api/object.rst:315 ../../c-api/object.rst:327
-#: ../../c-api/object.rst:352 ../../c-api/object.rst:403
-#: ../../c-api/object.rst:437 ../../c-api/object.rst:458
+#: ../../c-api/object.rst:316 ../../c-api/object.rst:328
+#: ../../c-api/object.rst:353 ../../c-api/object.rst:404
+#: ../../c-api/object.rst:438 ../../c-api/object.rst:459
msgid "built-in function"
msgstr "bulit-in function(內建函式)"
-#: ../../c-api/object.rst:315
+#: ../../c-api/object.rst:316
msgid "repr"
msgstr "repr"
-#: ../../c-api/object.rst:327
+#: ../../c-api/object.rst:328
msgid "ascii"
msgstr "ascii"
-#: ../../c-api/object.rst:335
+#: ../../c-api/object.rst:336
msgid "string"
msgstr "string(字串)"
-#: ../../c-api/object.rst:335
+#: ../../c-api/object.rst:336
msgid "PyObject_Str (C function)"
msgstr "PyObject_Str(C 函式)"
-#: ../../c-api/object.rst:352
+#: ../../c-api/object.rst:353
msgid "bytes"
msgstr "bytes(位元組)"
-#: ../../c-api/object.rst:403
+#: ../../c-api/object.rst:404
msgid "hash"
msgstr "hash(雜湊)"
-#: ../../c-api/object.rst:437
+#: ../../c-api/object.rst:438
msgid "type"
msgstr "type(型別)"
-#: ../../c-api/object.rst:458
+#: ../../c-api/object.rst:459
msgid "len"
msgstr "len"
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 919634426e..5aa8323e0c 100644
--- a/c-api/stable.po
+++ b/c-api/stable.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-01-19 00:03+0000\n"
+"POT-Creation-Date: 2024-12-04 00:14+0000\n"
"PO-Revision-Date: 2023-01-24 21:07+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -134,13 +134,13 @@ msgstr "受限 C API"
#: ../../c-api/stable.rst:67
msgid ""
"Python 3.2 introduced the *Limited API*, a subset of Python's C API. "
-"Extensions that only use the Limited API can be compiled once and work with "
-"multiple versions of Python. Contents of the Limited API are :ref:`listed "
+"Extensions that only use the Limited API can be compiled once and be loaded "
+"on multiple versions of Python. Contents of the Limited API are :ref:`listed "
"below `."
msgstr ""
"Python 3.2 引入了\\ *受限 API (Limited API)*,它是 Python C API 的一個子集。"
-"僅使用受限 API 的擴充可以只編譯一次就使用於多個版本的 Python。受限 API 的內容"
-"\\ :ref:`列在下方 `。"
+"僅使用受限 API 的擴充可以只編譯一次就被載入於多個版本的 Python。受限 API 的內"
+"容\\ :ref:`列在下方 `。"
#: ../../c-api/stable.rst:74
msgid ""
@@ -153,13 +153,12 @@ msgstr ""
msgid ""
"Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` "
"corresponding to the lowest Python version your extension supports. The "
-"extension will work without recompilation with all Python 3 releases from "
-"the specified one onward, and can use Limited API introduced up to that "
-"version."
+"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 版本一起使用,並且可以使用過去版本有引入的受限 API。"
+"macro:`PY_VERSION_HEX` 值。該擴充與從指定版本開始的所有 Python 3 版本之 ABI "
+"相容,並且可以使用過去版本有引入的受限 API。"
#: ../../c-api/stable.rst:83
msgid ""
@@ -186,12 +185,21 @@ msgstr "穩定 ABI"
#: ../../c-api/stable.rst:96
msgid ""
"To enable this, Python provides a *Stable ABI*: a set of symbols that will "
-"remain compatible across Python 3.x versions."
+"remain ABI-compatible across Python 3.x versions."
msgstr ""
"為了實現它,Python 提供了一個\\ *穩定 ABI (Stable ABI)*:一組將在各個 Python "
-"3.x 版本之間保持相容的符號。"
+"3.x 版本之間保持 ABI 相容的符號。"
-#: ../../c-api/stable.rst:99
+#: ../../c-api/stable.rst:101
+msgid ""
+"The Stable ABI prevents ABI issues, like linker errors due to missing "
+"symbols or data corruption due to changes in structure layouts or function "
+"signatures. However, other changes in Python can change the *behavior* of "
+"extensions. See Python's Backwards Compatibility Policy (:pep:`387`) for "
+"details."
+msgstr ""
+
+#: ../../c-api/stable.rst:107
msgid ""
"The Stable ABI contains symbols exposed in the :ref:`Limited API `, but also other ones – for example, functions necessary to support "
@@ -200,7 +208,7 @@ msgstr ""
"穩定 ABI 被包含在\\ :ref:`受限 API ` 中開放的符號,但也包含其"
"他符號 - 例如,支援舊版受限 API 所必需的函式。"
-#: ../../c-api/stable.rst:103
+#: ../../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."
@@ -209,7 +217,7 @@ msgstr ""
"在 Windows 上,使用穩定 ABI 的擴充應該連接到 ``python3.dll`` 而不是特定版本的"
"函式庫,例如 ``python39.dll``。"
-#: ../../c-api/stable.rst:107
+#: ../../c-api/stable.rst:115
msgid ""
"On some platforms, Python will look for and load shared library files named "
"with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such "
@@ -222,7 +230,7 @@ msgstr ""
"用者(或者打包工具)身上,例如使用 3.10+ 受限 API 建置的擴充不會為較低版本的 "
"Python 所安裝。"
-#: ../../c-api/stable.rst:114
+#: ../../c-api/stable.rst:122
msgid ""
"All functions in the Stable ABI are present as functions in Python's shared "
"library, not solely as macros. This makes them usable from languages that "
@@ -231,18 +239,18 @@ msgstr ""
"穩定 ABI 中的所有函式都作為函式存在於 Python 的共享函式庫中,而不僅是作為巨"
"集。這使得它們可被用於不使用 C 預處理器 (preprocessor) 的語言。"
-#: ../../c-api/stable.rst:120
+#: ../../c-api/stable.rst:128
msgid "Limited API Scope and Performance"
msgstr "受限 API 範圍和性能"
-#: ../../c-api/stable.rst:122
+#: ../../c-api/stable.rst:130
msgid ""
"The goal for the Limited API is to allow everything that is possible with "
"the full C API, but possibly with a performance penalty."
msgstr ""
"受限 API 的目標是允許使用完整的 C API 進行所有可能的操作,但可能會降低性能。"
-#: ../../c-api/stable.rst:125
+#: ../../c-api/stable.rst:133
msgid ""
"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro "
"variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because it "
@@ -252,7 +260,7 @@ msgstr ""
"`PyList_GET_ITEM` 為不可用。巨集運行可以更快,因為它可以依賴 list 物件的特定"
"版本實作細節。"
-#: ../../c-api/stable.rst:130
+#: ../../c-api/stable.rst:138
msgid ""
"Without ``Py_LIMITED_API`` defined, some C API functions are inlined or "
"replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, "
@@ -263,7 +271,7 @@ msgstr ""
"``Py_LIMITED_API`` 會禁用嵌入,從而隨著 Python 資料結構的改進而提高穩定性,但"
"可能會降低性能。"
-#: ../../c-api/stable.rst:135
+#: ../../c-api/stable.rst:143
msgid ""
"By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile "
"a Limited API extension with a version-specific ABI. This can improve "
@@ -277,11 +285,11 @@ msgstr ""
"將產生一個擴充,可以在特定版本的擴充不可用的地方發布 — 例如,用於即將發布的 "
"Python 版本的預發布版本 (prerelease)。"
-#: ../../c-api/stable.rst:144
+#: ../../c-api/stable.rst:152
msgid "Limited API Caveats"
msgstr "受限 API 注意事項"
-#: ../../c-api/stable.rst:146
+#: ../../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:"
@@ -293,7 +301,7 @@ msgstr ""
"``Py_LIMITED_API`` 僅涵蓋定義,但 API 還包括其他議題,例如預期的語義 "
"(semantic)。"
-#: ../../c-api/stable.rst:151
+#: ../../c-api/stable.rst:159
msgid ""
"One issue that ``Py_LIMITED_API`` does not guard against is calling a "
"function with arguments that are invalid in a lower Python version. For "
@@ -307,7 +315,7 @@ msgstr ""
"現在代表選擇預設行為,但在 Python 3.8 中,引數將被直接使用,導致 ``NULL`` 取"
"消參照 (dereference) 且崩潰 (crash)。類似的引數適用於結構 (struct) 的欄位。"
-#: ../../c-api/stable.rst:158
+#: ../../c-api/stable.rst:166
msgid ""
"Another issue is that some struct fields are currently not hidden when "
"``Py_LIMITED_API`` is defined, even though they're part of the Limited API."
@@ -315,7 +323,7 @@ msgstr ""
"另一個問題是,當有定義 ``Py_LIMITED_API`` 時,一些結構欄位目前不會被隱藏,即"
"使它們是受限 API 的一部分。"
-#: ../../c-api/stable.rst:161
+#: ../../c-api/stable.rst:169
msgid ""
"For these reasons, we recommend testing an extension with *all* minor Python "
"versions it supports, and preferably to build with the *lowest* such version."
@@ -323,7 +331,7 @@ msgstr ""
"出於這些原因,我們建議要以它支援的\\ *所有*\\ 次要 Python 版本來測試擴充,並"
"且最好使用\\ *最低*\\ 版本進行建置。"
-#: ../../c-api/stable.rst:164
+#: ../../c-api/stable.rst:172
msgid ""
"We also recommend reviewing documentation of all used API to check if it is "
"explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a "
@@ -334,7 +342,7 @@ msgstr ""
"義 ``Py_LIMITED_API``,一些私有聲明也會因為技術原因(或者甚至是無意地,例如臭"
"蟲)而被公開出來。"
-#: ../../c-api/stable.rst:169
+#: ../../c-api/stable.rst:177
msgid ""
"Also note that the Limited API is not necessarily stable: compiling with "
"``Py_LIMITED_API`` with Python 3.8 means that the extension will run with "
@@ -346,11 +354,11 @@ msgstr ""
"行編譯意味著擴充將能以 Python 3.12 運行,但不一定能以 Python 3.12 *編譯*。特"
"別是如果穩定 ABI 保持穩定,部分受限 API 可能會被棄用和刪除。"
-#: ../../c-api/stable.rst:179
+#: ../../c-api/stable.rst:187
msgid "Platform Considerations"
msgstr "平台注意事項"
-#: ../../c-api/stable.rst:181
+#: ../../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:"
@@ -361,7 +369,7 @@ msgstr ""
"於\\ :ref:`穩定 ABI ` 的目的,這些細節定義了一個「平台」。它們通"
"常取決於作業系統種類和處理器架構"
-#: ../../c-api/stable.rst:186
+#: ../../c-api/stable.rst:194
msgid ""
"It is the responsibility of each particular distributor of Python to ensure "
"that all Python versions on a particular platform are built in a way that "
@@ -372,11 +380,11 @@ msgstr ""
"定 ABI 的方式建置。``python.org`` 和許多第三方發布者發布的 Windows 和 macOS "
"版本就是這種情況。"
-#: ../../c-api/stable.rst:196
+#: ../../c-api/stable.rst:204
msgid "Contents of Limited API"
msgstr "受限 API 的內容"
-#: ../../c-api/stable.rst:199
+#: ../../c-api/stable.rst:207
msgid ""
"Currently, the :ref:`Limited API ` includes the following "
"items:"
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/sys.po b/c-api/sys.po
index 5fa011518f..9037d85432 100644
--- a/c-api/sys.po
+++ b/c-api/sys.po
@@ -10,7 +10,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: 2024-12-12 00:15+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-"
@@ -486,6 +486,10 @@ msgid ""
"should be called by *func*."
msgstr ""
+#: ../../c-api/sys.rst:432
+msgid ":c:func:`PyUnstable_AtExit` for passing a ``void *data`` argument."
+msgstr ""
+
#: ../../c-api/sys.rst:101
msgid "USE_STACKCHECK (C macro)"
msgstr "USE_STACKCHECK(C 巨集)"
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 9ca76377b5..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-09-27 00:14+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:517
+#: ../../c-api/type.rst:521
msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API."
msgstr ""
-#: ../../c-api/type.rst:519
+#: ../../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:526
+#: ../../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:529
+#: ../../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 8ebbcebe8f..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: 2024-09-28 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,43 +90,49 @@ 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 "
@@ -132,15 +140,15 @@ msgid ""
"`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,13 +156,13 @@ 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 "
@@ -164,158 +172,163 @@ msgid ""
"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."
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."
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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+msgstr "回傳轉換為小寫的 *ch* 字元。"
-#: ../../c-api/unicode.rst:278
+#: ../../c-api/unicode.rst:279
msgid "Return the character *ch* converted to upper case."
-msgstr ""
+msgstr "回傳轉換為大寫的 *ch* 字元。"
-#: ../../c-api/unicode.rst:283
+#: ../../c-api/unicode.rst:284
msgid "Return the character *ch* converted to title case."
-msgstr ""
+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."
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."
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."
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 ""
+msgstr "這些 API 可用於處理代理字元:"
-#: ../../c-api/unicode.rst:308
+#: ../../c-api/unicode.rst:309
msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)."
-msgstr ""
+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 "
@@ -323,34 +336,34 @@ 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:"
@@ -358,7 +371,7 @@ msgid ""
"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:"
@@ -366,7 +379,7 @@ msgid ""
"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 "
@@ -374,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 "
@@ -405,23 +418,23 @@ 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:"
@@ -429,7 +442,7 @@ msgid ""
"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 "
@@ -437,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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 物件。"
+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 ""
+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 ""
+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`."
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`."
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 "
@@ -756,28 +769,30 @@ 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 ""
+msgstr "新增對 ``\"%lld\"`` 和 ``\"%llu\"`` 的支援。"
-#: ../../c-api/unicode.rst:559
+#: ../../c-api/unicode.rst:560
msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added."
-msgstr ""
+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."
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 "
@@ -786,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 ""
+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 ""
+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:`!"
@@ -855,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]``."
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."
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 ""
+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."
msgstr ""
-#: ../../c-api/unicode.rst:675
+#: ../../c-api/unicode.rst:693
msgid "Return character on success, ``-1`` on error with an exception set."
-msgstr ""
+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 "
@@ -917,7 +954,7 @@ 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:"
@@ -925,17 +962,17 @@ msgid ""
"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 "
@@ -944,21 +981,21 @@ 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`."
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 ""
+msgstr "此函式會忽略 :ref:`Python UTF-8 模式 `。"
-#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:832
+#: ../../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:"
@@ -966,13 +1003,15 @@ msgid ""
"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`."
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 "
@@ -981,17 +1020,17 @@ msgid ""
"`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`."
msgstr ""
-#: ../../c-api/unicode.rst:770 ../../c-api/unicode.rst:863
+#: ../../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:"
@@ -999,103 +1038,124 @@ msgid ""
"locale encoding was used for ``strict``."
msgstr ""
-#: ../../c-api/unicode.rst:783
+#: ../../c-api/unicode.rst:801
msgid "File System Encoding"
-msgstr ""
+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:"
+"``\"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 ""
-"ParseTuple converter: encode :class:`str` objects -- 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 a :c:expr:`PyBytesObject*` which must be released when it "
-"is no longer used."
+":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` "
+"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 "
+"` which must be released when it is no longer used and return "
+"a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null bytes are "
+"not allowed in the result. On failure, return ``0`` with an exception set."
msgstr ""
-#: ../../c-api/unicode.rst:802 ../../c-api/unicode.rst:819
-msgid "Accepts a :term:`path-like object`."
+#: ../../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:805
+#: ../../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: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 "
+"converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the "
"conversion function:"
msgstr ""
-#: ../../c-api/unicode.rst:811
+#: ../../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."
+msgstr ""
+
+#: ../../c-api/unicode.rst:851
msgid ""
-"ParseTuple 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 a :c:expr:`PyUnicodeObject*` "
-"which must be released when it is no longer used."
+"If *obj* is ``NULL``, release the strong reference to the object referred to "
+"by *result* and return ``1``."
msgstr ""
-#: ../../c-api/unicode.rst:825
+#: ../../c-api/unicode.rst:862
msgid "Decode a string from the :term:`filesystem encoding and error handler`."
msgstr ""
-#: ../../c-api/unicode.rst:827
+#: ../../c-api/unicode.rst:864
msgid ""
"If you need to decode a string from the current locale encoding, use :c:func:"
"`PyUnicode_DecodeLocaleAndSize`."
msgstr ""
-#: ../../c-api/unicode.rst:834 ../../c-api/unicode.rst:847
-#: ../../c-api/unicode.rst:867
+#: ../../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:841
+#: ../../c-api/unicode.rst:878
msgid ""
"Decode a null-terminated string from the :term:`filesystem encoding and "
"error handler`."
msgstr ""
-#: ../../c-api/unicode.rst:844
+#: ../../c-api/unicode.rst:881
msgid ""
"If the string length is known, use :c:func:"
"`PyUnicode_DecodeFSDefaultAndSize`."
-msgstr ""
+msgstr "如果字串長度已知,請使用 :c:func:`PyUnicode_DecodeFSDefaultAndSize`。"
-#: ../../c-api/unicode.rst:854
+#: ../../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:858
+#: ../../c-api/unicode.rst:895
msgid ""
"If you need to encode a string to the current locale encoding, use :c:func:"
"`PyUnicode_EncodeLocale`."
msgstr ""
-#: ../../c-api/unicode.rst:872
+#: ../../c-api/unicode.rst:909
msgid "wchar_t Support"
msgstr "wchar_t 支援"
-#: ../../c-api/unicode.rst:874
+#: ../../c-api/unicode.rst:911
msgid ":c:type:`wchar_t` support for platforms which support it:"
-msgstr ""
+msgstr "對支援 :c:type:`wchar_t` 的平台提供支援:"
-#: ../../c-api/unicode.rst:878
+#: ../../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 "
@@ -1103,7 +1163,7 @@ msgid ""
"failure."
msgstr ""
-#: ../../c-api/unicode.rst:886
+#: ../../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 "
@@ -1111,13 +1171,13 @@ msgid ""
"`wchar_t` characters copied or ``-1`` in case of an error."
msgstr ""
-#: ../../c-api/unicode.rst:891
+#: ../../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:894
+#: ../../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:"
@@ -1127,7 +1187,7 @@ msgid ""
"most C functions."
msgstr ""
-#: ../../c-api/unicode.rst:904
+#: ../../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 "
@@ -1138,37 +1198,37 @@ msgid ""
"`wchar_t*` string contains null characters a :exc:`ValueError` is raised."
msgstr ""
-#: ../../c-api/unicode.rst:912
+#: ../../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:919
+#: ../../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:927
+#: ../../c-api/unicode.rst:964
msgid "Built-in Codecs"
-msgstr ""
+msgstr "內建編解碼器"
-#: ../../c-api/unicode.rst:929
+#: ../../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:932
+#: ../../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:936
+#: ../../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 "
@@ -1176,28 +1236,28 @@ msgid ""
"handler` internally."
msgstr ""
-#: ../../c-api/unicode.rst:941
+#: ../../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:945
+#: ../../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:950
+#: ../../c-api/unicode.rst:987
msgid "Generic Codecs"
-msgstr ""
+msgstr "泛用編解碼器"
-#: ../../c-api/unicode.rst:952
+#: ../../c-api/unicode.rst:989
msgid "These are the generic codec APIs:"
-msgstr ""
+msgstr "這些是泛用編解碼器的 API:"
-#: ../../c-api/unicode.rst:958
+#: ../../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 "
@@ -1206,7 +1266,7 @@ msgid ""
"was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:968
+#: ../../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 "
@@ -1215,21 +1275,21 @@ msgid ""
"was raised by the codec."
msgstr ""
-#: ../../c-api/unicode.rst:976
+#: ../../c-api/unicode.rst:1013
msgid "UTF-8 Codecs"
msgstr "UTF-8 編解碼器"
-#: ../../c-api/unicode.rst:978
+#: ../../c-api/unicode.rst:1015
msgid "These are the UTF-8 codec APIs:"
-msgstr ""
+msgstr "這些是 UTF-8 編解碼器的 API:"
-#: ../../c-api/unicode.rst:983
+#: ../../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:990
+#: ../../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 "
@@ -1237,20 +1297,20 @@ msgid ""
"of bytes that have been decoded will be stored in *consumed*."
msgstr ""
-#: ../../c-api/unicode.rst:998
+#: ../../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:1002 ../../c-api/unicode.rst:1017
+#: ../../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:1008
+#: ../../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* "
@@ -1259,13 +1319,15 @@ msgid ""
"regardless of whether there are any other null code points."
msgstr ""
-#: ../../c-api/unicode.rst:1014
+#: ../../c-api/unicode.rst:1051
msgid ""
"On error, set an exception, set *size* to ``-1`` (if it's not NULL) and "
"return ``NULL``."
msgstr ""
+"發生錯誤時,設定例外並將 *size* 設為 ``-1``\\ (如果不是 NULL),並回傳 "
+"``NULL``。"
-#: ../../c-api/unicode.rst:1020
+#: ../../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 "
@@ -1274,47 +1336,57 @@ msgid ""
"collected."
msgstr ""
-#: ../../c-api/unicode.rst:1027 ../../c-api/unicode.rst:1040
+#: ../../c-api/unicode.rst:1064 ../../c-api/unicode.rst:1086
msgid "The return type is now ``const char *`` rather of ``char *``."
-msgstr ""
+msgstr "回傳型別現在是 ``const char *`` 而不是 ``char *``。"
-#: ../../c-api/unicode.rst:1030
+#: ../../c-api/unicode.rst:1067
msgid "This function is a part of the :ref:`limited API `."
msgstr ""
-#: ../../c-api/unicode.rst:1036
+#: ../../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: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."
msgstr ""
-#: ../../c-api/unicode.rst:1045
+#: ../../c-api/unicode.rst:1091
msgid "UTF-32 Codecs"
msgstr "UTF-32 編解碼器"
-#: ../../c-api/unicode.rst:1047
+#: ../../c-api/unicode.rst:1093
msgid "These are the UTF-32 codec APIs:"
-msgstr ""
+msgstr "這些是 UTF-32 編解碼器的 API:"
-#: ../../c-api/unicode.rst:1053
+#: ../../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:1057 ../../c-api/unicode.rst:1107
+#: ../../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:1060 ../../c-api/unicode.rst:1110
+#: ../../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:1064
+#: ../../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 "
@@ -1322,21 +1394,21 @@ msgid ""
"``-1`` or ``1``, any byte order mark is copied to the output."
msgstr ""
-#: ../../c-api/unicode.rst:1069
+#: ../../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:1072 ../../c-api/unicode.rst:1123
+#: ../../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:1074 ../../c-api/unicode.rst:1125
+#: ../../c-api/unicode.rst:1120 ../../c-api/unicode.rst:1171
msgid "Return ``NULL`` if an exception was raised by the codec."
-msgstr ""
+msgstr "如果編解碼器引發例外則回傳 ``NULL``。"
-#: ../../c-api/unicode.rst:1080
+#: ../../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 "
@@ -1345,29 +1417,29 @@ msgid ""
"number of bytes that have been decoded will be stored in *consumed*."
msgstr ""
-#: ../../c-api/unicode.rst:1089
+#: ../../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:1095
+#: ../../c-api/unicode.rst:1141
msgid "UTF-16 Codecs"
msgstr "UTF-16 編解碼器"
-#: ../../c-api/unicode.rst:1097
+#: ../../c-api/unicode.rst:1143
msgid "These are the UTF-16 codec APIs:"
-msgstr ""
+msgstr "這些是 UTF-16 編解碼器的 API:"
-#: ../../c-api/unicode.rst:1103
+#: ../../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:1114
+#: ../../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 "
@@ -1376,13 +1448,13 @@ msgid ""
"result in either a ``\\ufeff`` or a ``\\ufffe`` character)."
msgstr ""
-#: ../../c-api/unicode.rst:1120
+#: ../../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:1131
+#: ../../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 "
@@ -1392,28 +1464,28 @@ msgid ""
"*consumed*."
msgstr ""
-#: ../../c-api/unicode.rst:1140
+#: ../../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:1146
+#: ../../c-api/unicode.rst:1192
msgid "UTF-7 Codecs"
msgstr "UTF-7 編解碼器"
-#: ../../c-api/unicode.rst:1148
+#: ../../c-api/unicode.rst:1194
msgid "These are the UTF-7 codec APIs:"
-msgstr ""
+msgstr "這些是 UTF-7 編解碼器的 API:"
-#: ../../c-api/unicode.rst:1153
+#: ../../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:1160
+#: ../../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 "
@@ -1421,101 +1493,101 @@ msgid ""
"of bytes that have been decoded will be stored in *consumed*."
msgstr ""
-#: ../../c-api/unicode.rst:1167
+#: ../../c-api/unicode.rst:1213
msgid "Unicode-Escape Codecs"
msgstr ""
-#: ../../c-api/unicode.rst:1169
+#: ../../c-api/unicode.rst:1215
msgid "These are the \"Unicode Escape\" codec APIs:"
msgstr ""
-#: ../../c-api/unicode.rst:1175
+#: ../../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:1181
+#: ../../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:1187
+#: ../../c-api/unicode.rst:1233
msgid "Raw-Unicode-Escape Codecs"
msgstr ""
-#: ../../c-api/unicode.rst:1189
+#: ../../c-api/unicode.rst:1235
msgid "These are the \"Raw Unicode Escape\" codec APIs:"
msgstr ""
-#: ../../c-api/unicode.rst:1195
+#: ../../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:1201
+#: ../../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:1207
+#: ../../c-api/unicode.rst:1253
msgid "Latin-1 Codecs"
msgstr "Latin-1 編解碼器"
-#: ../../c-api/unicode.rst:1209
+#: ../../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:1215
+#: ../../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:1221
+#: ../../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:1227
+#: ../../c-api/unicode.rst:1273
msgid "ASCII Codecs"
msgstr "ASCII 編解碼器"
-#: ../../c-api/unicode.rst:1229
+#: ../../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:1235
+#: ../../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:1241
+#: ../../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:1247
+#: ../../c-api/unicode.rst:1293
msgid "Character Map Codecs"
msgstr ""
-#: ../../c-api/unicode.rst:1249
+#: ../../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 "
@@ -1525,18 +1597,18 @@ msgid ""
"sequences work well."
msgstr ""
-#: ../../c-api/unicode.rst:1255
+#: ../../c-api/unicode.rst:1301
msgid "These are the mapping codec APIs:"
-msgstr ""
+msgstr "這些是對映編解碼器的 API:"
-#: ../../c-api/unicode.rst:1260
+#: ../../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:1264
+#: ../../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 "
@@ -1546,14 +1618,14 @@ msgid ""
"treated as undefined mappings and cause an error."
msgstr ""
-#: ../../c-api/unicode.rst:1275
+#: ../../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:1279
+#: ../../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 "
@@ -1561,41 +1633,41 @@ msgid ""
"``None`` are treated as \"undefined mapping\" and cause an error."
msgstr ""
-#: ../../c-api/unicode.rst:1285
+#: ../../c-api/unicode.rst:1331
msgid "The following codec API is special in that maps Unicode to Unicode."
msgstr ""
-#: ../../c-api/unicode.rst:1289
+#: ../../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:1293
+#: ../../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:1296
+#: ../../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:1300
+#: ../../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:1305
+#: ../../c-api/unicode.rst:1351
msgid "MBCS codecs for Windows"
-msgstr ""
+msgstr "Windows 的 MBCS 編解碼器"
-#: ../../c-api/unicode.rst:1307
+#: ../../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 "
@@ -1603,13 +1675,13 @@ msgid ""
"is defined by the user settings on the machine running the codec."
msgstr ""
-#: ../../c-api/unicode.rst:1314
+#: ../../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:1321
+#: ../../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 "
@@ -1617,44 +1689,50 @@ msgid ""
"will be stored in *consumed*."
msgstr ""
-#: ../../c-api/unicode.rst:1329
+#: ../../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:1336
+#: ../../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."
msgstr ""
-#: ../../c-api/unicode.rst:1344
+#: ../../c-api/unicode.rst:1397
msgid "Methods & Slots"
msgstr ""
-#: ../../c-api/unicode.rst:1350
+#: ../../c-api/unicode.rst:1403
msgid "Methods and Slot Functions"
msgstr ""
-#: ../../c-api/unicode.rst:1352
+#: ../../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:1356
+#: ../../c-api/unicode.rst:1409
msgid "They all return ``NULL`` or ``-1`` if an exception occurs."
-msgstr ""
+msgstr "如果發生例外,則回傳 ``NULL`` 或 ``-1``。"
-#: ../../c-api/unicode.rst:1361
+#: ../../c-api/unicode.rst:1414
msgid "Concat two strings giving a new Unicode string."
msgstr ""
-#: ../../c-api/unicode.rst:1366
+#: ../../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 "
@@ -1663,27 +1741,73 @@ msgid ""
"list."
msgstr ""
-#: ../../c-api/unicode.rst:1374
+#: ../../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:1381
+#: ../../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:1388
+#: ../../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:1396
+#: ../../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, "
@@ -1692,7 +1816,7 @@ msgid ""
"``-2`` indicates that an error occurred and an exception has been set."
msgstr ""
-#: ../../c-api/unicode.rst:1406
+#: ../../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 "
@@ -1702,37 +1826,37 @@ msgid ""
"set."
msgstr ""
-#: ../../c-api/unicode.rst:1414
+#: ../../c-api/unicode.rst:1508
msgid ""
"*start* and *end* are now adjusted to behave like ``unicode[start:end]``."
msgstr ""
-#: ../../c-api/unicode.rst:1421
+#: ../../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:1428
+#: ../../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:1435
+#: ../../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:1438
+#: ../../c-api/unicode.rst:1532
msgid ""
"This function returns ``-1`` upon failure, so one should call :c:func:"
"`PyErr_Occurred` to check for errors."
msgstr ""
-#: ../../c-api/unicode.rst:1444
+#: ../../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 "
@@ -1741,18 +1865,18 @@ msgid ""
"is returned."
msgstr ""
-#: ../../c-api/unicode.rst:1451 ../../c-api/unicode.rst:1472
+#: ../../c-api/unicode.rst:1545 ../../c-api/unicode.rst:1566
msgid "This function does not raise exceptions."
-msgstr ""
+msgstr "此函式不會引發例外。"
-#: ../../c-api/unicode.rst:1458
+#: ../../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:1467
+#: ../../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 "
@@ -1760,47 +1884,47 @@ msgid ""
"string as ISO-8859-1 if it contains non-ASCII characters."
msgstr ""
-#: ../../c-api/unicode.rst:1477
+#: ../../c-api/unicode.rst:1571
msgid "Rich compare two Unicode strings and return one of the following:"
msgstr ""
-#: ../../c-api/unicode.rst:1479
+#: ../../c-api/unicode.rst:1573
msgid "``NULL`` in case an exception was raised"
msgstr ""
-#: ../../c-api/unicode.rst:1480
+#: ../../c-api/unicode.rst:1574
msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons"
msgstr ""
-#: ../../c-api/unicode.rst:1481
+#: ../../c-api/unicode.rst:1575
msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown"
msgstr ""
-#: ../../c-api/unicode.rst:1483
+#: ../../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`."
msgstr ""
-#: ../../c-api/unicode.rst:1489
+#: ../../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:1495
+#: ../../c-api/unicode.rst:1589
msgid ""
"Check whether *substr* is contained in *unicode* and return true or false "
"accordingly."
msgstr ""
-#: ../../c-api/unicode.rst:1498
+#: ../../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:1504
+#: ../../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. "
@@ -1811,7 +1935,7 @@ msgid ""
"interns it."
msgstr ""
-#: ../../c-api/unicode.rst:1511
+#: ../../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; "
@@ -1819,39 +1943,39 @@ msgid ""
"the result.)"
msgstr ""
-#: ../../c-api/unicode.rst:1516
+#: ../../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:1519
+#: ../../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."
msgstr ""
-#: ../../c-api/unicode.rst:1523
+#: ../../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:1529
+#: ../../c-api/unicode.rst:1623
msgid ""
"A combination of :c:func:`PyUnicode_FromString` and :c:func:"
"`PyUnicode_InternInPlace`, meant for statically allocated strings."
msgstr ""
-#: ../../c-api/unicode.rst:1532
+#: ../../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:1536
+#: ../../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 "
@@ -1860,6 +1984,6 @@ msgid ""
"`PyUnicode_InternInPlace` directly."
msgstr ""
-#: ../../c-api/unicode.rst:1544
+#: ../../c-api/unicode.rst:1638
msgid "Strings interned this way are made :term:`immortal`."
msgstr ""
diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po
index 468bb4f7bf..80cabb8b50 100644
--- a/c-api/veryhigh.po
+++ b/c-api/veryhigh.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-10-09 00:13+0000\n"
+"POT-Creation-Date: 2025-01-22 00:13+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-"
@@ -390,7 +390,17 @@ msgstr ""
msgid "Added *cf_feature_version* field."
msgstr "新增 *cf_feature_version* 欄位。"
-#: ../../c-api/veryhigh.rst:354
+#: ../../c-api/veryhigh.rst:351
+msgid "The available compiler flags are accessible as macros:"
+msgstr ""
+
+#: ../../c-api/veryhigh.rst:360
+msgid ""
+"See :ref:`compiler flags ` in documentation of the :py:"
+"mod:`!ast` Python module, which exports these constants under the same names."
+msgstr ""
+
+#: ../../c-api/veryhigh.rst:366
msgid ""
"This bit can be set in *flags* to cause division operator ``/`` to be "
"interpreted as \"true division\" according to :pep:`238`."
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