diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0f96ff72e0..a6bd32c1cd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -5,12 +5,19 @@ on:
jobs:
ci:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
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 }} MODE=dummy make all
+ 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 38d9e70fa1..2c7442c1a8 100644
--- a/.github/workflows/deploy-gh-page.yml
+++ b/.github/workflows/deploy-gh-page.yml
@@ -3,7 +3,7 @@ name: deploy-gh-page
on:
push:
branches:
- - "3.12"
+ - "3.13"
jobs:
cd:
@@ -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: make all
+ run: JOBS=4 MODE=html make all
- name: Deploy to gh page
- uses: JamesIves/github-pages-deploy-action@v4.6.3
+ uses: JamesIves/github-pages-deploy-action@v4.7.3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
diff --git a/.github/workflows/py312-sync-cpython.yml b/.github/workflows/py313-sync-cpython.yml
similarity index 85%
rename from .github/workflows/py312-sync-cpython.yml
rename to .github/workflows/py313-sync-cpython.yml
index f10378c019..f3362c52c5 100644
--- a/.github/workflows/py312-sync-cpython.yml
+++ b/.github/workflows/py313-sync-cpython.yml
@@ -1,9 +1,9 @@
-name: python-3.12-sync-with-cpython
+name: python-3.13-sync-with-cpython
on:
push:
branches:
- - "3.12"
+ - "3.13"
schedule:
- cron: "0 0 * * *"
@@ -11,8 +11,8 @@ jobs:
sync:
runs-on: ubuntu-latest
env:
- VERSION: "3.12"
- BRANCH: "cron/sync/3.12"
+ VERSION: "3.13"
+ BRANCH: "cron/sync/3.13"
steps:
- uses: actions/checkout@v4
with:
@@ -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
@@ -50,15 +53,15 @@ jobs:
base: ${{ env.VERSION }}
branch: ${{ env.BRANCH }}
delete-branch: false
- title: 'Sync with CPython ${{ env.VERSION }}'
+ title: "Sync with CPython ${{ env.VERSION }}"
body: |
Sync with CPython ${{ env.VERSION }}
draft: true
labels: |
sync-cpython
automation
-
+
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
- echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
\ No newline at end of file
+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
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/.gitignore b/.gitignore
index 185f2c0f70..948c289ec6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,12 @@
*.mo
__pycache__
.DS_Store
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
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/.scripts/poetry.lock b/.scripts/poetry.lock
index 482702ad5f..7b17f463ce 100644
--- a/.scripts/poetry.lock
+++ b/.scripts/poetry.lock
@@ -1,9 +1,10 @@
-# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
+# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand.
[[package]]
name = "certifi"
version = "2024.8.30"
description = "Python package for providing Mozilla's CA Bundle."
+category = "main"
optional = false
python-versions = ">=3.6"
files = [
@@ -15,6 +16,7 @@ files = [
name = "chardet"
version = "3.0.4"
description = "Universal encoding detector for Python 2 and 3"
+category = "main"
optional = false
python-versions = "*"
files = [
@@ -24,107 +26,124 @@ files = [
[[package]]
name = "charset-normalizer"
-version = "3.3.2"
+version = "3.4.0"
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
+category = "main"
optional = false
python-versions = ">=3.7.0"
files = [
- {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"},
- {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"},
- {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"},
- {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"},
- {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"},
- {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"},
- {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"},
- {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-win32.whl", hash = "sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc"},
+ {file = "charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-win32.whl", hash = "sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99"},
+ {file = "charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-win32.whl", hash = "sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7"},
+ {file = "charset_normalizer-3.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-win32.whl", hash = "sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67"},
+ {file = "charset_normalizer-3.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-win32.whl", hash = "sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149"},
+ {file = "charset_normalizer-3.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-win32.whl", hash = "sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613"},
+ {file = "charset_normalizer-3.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-win32.whl", hash = "sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2"},
+ {file = "charset_normalizer-3.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca"},
+ {file = "charset_normalizer-3.4.0-py3-none-any.whl", hash = "sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079"},
+ {file = "charset_normalizer-3.4.0.tar.gz", hash = "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e"},
]
[[package]]
name = "googletrans"
version = "3.1.0a0"
description = "Free Google Translate API for Python. Translates totally free of charge."
+category = "main"
optional = false
python-versions = ">=3.6"
files = [
@@ -138,6 +157,7 @@ httpx = "0.13.3"
name = "h11"
version = "0.9.0"
description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
+category = "main"
optional = false
python-versions = "*"
files = [
@@ -149,6 +169,7 @@ files = [
name = "h2"
version = "3.2.0"
description = "HTTP/2 State-Machine based protocol implementation"
+category = "main"
optional = false
python-versions = "*"
files = [
@@ -164,6 +185,7 @@ hyperframe = ">=5.2.0,<6"
name = "hpack"
version = "3.0.0"
description = "Pure-Python HPACK header compression"
+category = "main"
optional = false
python-versions = "*"
files = [
@@ -173,19 +195,21 @@ files = [
[[package]]
name = "hstspreload"
-version = "2024.9.1"
+version = "2024.10.1"
description = "Chromium HSTS Preload list as a Python package"
+category = "main"
optional = false
python-versions = ">=3.6"
files = [
- {file = "hstspreload-2024.9.1-py3-none-any.whl", hash = "sha256:9c1b2d0313899d3ff9dac03ab39d53fed95c32eef9862e7eabee8dc07dfd589c"},
- {file = "hstspreload-2024.9.1.tar.gz", hash = "sha256:2ab4518495a132c4ae430c474afffd12938852c6eec68ce1368c8f7858dc3076"},
+ {file = "hstspreload-2024.10.1-py3-none-any.whl", hash = "sha256:3ab481036cbdff095cb411dafe33ee7924492319cf6ddaf4e776a159537541b3"},
+ {file = "hstspreload-2024.10.1.tar.gz", hash = "sha256:2859a6b52253743ddddad468d8c9570ba650170ca49ac416336826915ee409b8"},
]
[[package]]
name = "httpcore"
version = "0.9.1"
description = "A minimal low-level HTTP client."
+category = "main"
optional = false
python-versions = ">=3.6"
files = [
@@ -195,13 +219,14 @@ files = [
[package.dependencies]
h11 = ">=0.8,<0.10"
-h2 = "==3.*"
-sniffio = "==1.*"
+h2 = ">=3.0.0,<4.0.0"
+sniffio = ">=1.0.0,<2.0.0"
[[package]]
name = "httpx"
version = "0.13.3"
description = "The next generation HTTP client."
+category = "main"
optional = false
python-versions = ">=3.6"
files = [
@@ -211,10 +236,10 @@ files = [
[package.dependencies]
certifi = "*"
-chardet = "==3.*"
+chardet = ">=3.0.0,<4.0.0"
hstspreload = "*"
-httpcore = "==0.9.*"
-idna = "==2.*"
+httpcore = ">=0.9.0,<0.10.0"
+idna = ">=2.0.0,<3.0.0"
rfc3986 = ">=1.3,<2"
sniffio = "*"
@@ -222,6 +247,7 @@ sniffio = "*"
name = "hyperframe"
version = "5.2.0"
description = "HTTP/2 framing layer for Python"
+category = "main"
optional = false
python-versions = "*"
files = [
@@ -233,6 +259,7 @@ files = [
name = "idna"
version = "2.10"
description = "Internationalized Domain Names in Applications (IDNA)"
+category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
files = [
@@ -244,6 +271,7 @@ files = [
name = "lxml"
version = "5.3.0"
description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API."
+category = "main"
optional = false
python-versions = ">=3.6"
files = [
@@ -398,6 +426,7 @@ source = ["Cython (>=3.0.11)"]
name = "polib"
version = "1.1.1"
description = "A library to manipulate gettext files (po and mo files)."
+category = "main"
optional = false
python-versions = "*"
files = [
@@ -409,6 +438,7 @@ files = [
name = "requests"
version = "2.31.0"
description = "Python HTTP for Humans."
+category = "main"
optional = false
python-versions = ">=3.7"
files = [
@@ -430,6 +460,7 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
name = "rfc3986"
version = "1.5.0"
description = "Validating URI References per RFC 3986"
+category = "main"
optional = false
python-versions = "*"
files = [
@@ -444,6 +475,7 @@ idna2008 = ["idna"]
name = "sniffio"
version = "1.3.1"
description = "Sniff out which async library your code is running under"
+category = "main"
optional = false
python-versions = ">=3.7"
files = [
@@ -455,6 +487,7 @@ files = [
name = "translate-toolkit"
version = "3.8.1"
description = "Tools and API for translation and localization engineering."
+category = "main"
optional = false
python-versions = ">=3.7"
files = [
@@ -483,13 +516,14 @@ yaml = ["ruamel.yaml (==0.17.21)"]
[[package]]
name = "urllib3"
-version = "2.2.2"
+version = "2.2.3"
description = "HTTP library with thread-safe connection pooling, file post, and more."
+category = "main"
optional = false
python-versions = ">=3.8"
files = [
- {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"},
- {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"},
+ {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"},
+ {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"},
]
[package.extras]
diff --git a/Makefile b/Makefile
index b1793e0908..c0da35f4af 100644
--- a/Makefile
+++ b/Makefile
@@ -38,13 +38,13 @@ endef
export PRINT_HELP_PYSCRIPT # End of python section
CPYTHON_CLONE := ../cpython
-VERSION := $(or $(VERSION), 3.12)
+VERSION := $(or $(VERSION), 3.13)
SPHINX_CONF := $(CPYTHON_CLONE)/Doc/conf.py
LANGUAGE := zh_TW
LC_MESSAGES := $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES
VENV := ~/.venvs/python-docs-i18n/
-MODE := autobuild-dev-html
-JOBS := 4
+MODE := $(or $(MODE), autobuild-dev-html)
+JOBS := $(or $(JOBS), auto)
.PHONY: all
all: prepare_deps ## Automatically build an html local version
@@ -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 385d4ee165..4a5fcd7f1e 100644
--- a/README.rst
+++ b/README.rst
@@ -6,7 +6,7 @@ Python 官方說明文件臺灣繁體中文翻譯計畫
:target: https://discord.gg/44XheGXhWH
:alt: Join Chat on Discord
-這是 Python 3.12 官方說明文件的臺灣繁體中文(zh_TW)翻譯。
+這是 Python 3.13 官方說明文件的臺灣繁體中文(zh_TW)翻譯。
翻譯之前,請務必詳讀並同意\ `授權與 License`_。參與方式請參考\ `參與翻譯`_。
@@ -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
@@ -132,13 +133,13 @@ the PSF for inclusion in the documentation.
接著在 terminal 裡按照以下步驟:
-1. 基於最新版本的 ``upstream/3.12`` 開啟一個 branch,現在假設我們想要翻譯 library/math.po \
+1. 基於最新版本的 ``upstream/3.13`` 開啟一個 branch,現在假設我們想要翻譯 library/math.po \
所以把這個 branch 叫做 ``library/math``:
.. code-block:: bash
git fetch upstream
- git checkout -b library/math upstream/3.12
+ git checkout -b library/math upstream/3.13
2. 接著就可以開始翻譯(翻譯時可參考\ `翻譯守則`_),你可以手動開啟 Poedit 應用程式再選 \
library/math.po 檔案打開
@@ -222,7 +223,7 @@ the PSF for inclusion in the documentation.
- 從 upstream(我們的主要 GitHub repo)做 fetch 的動作
- 對 origin(你的 fork)做 push
-- 永遠不對 ``3.12`` branch 進行修改,請保持讓這個 branch 唯讀,可以避免掉很多問題。
+- 永遠不對 ``3.13`` branch 進行修改,請保持讓這個 branch 唯讀,可以避免掉很多問題。
要翻譯哪些東西
--------------
@@ -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 4b90148fd5..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:
@@ -12,9 +11,9 @@
# hsiao yi , 2015
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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/bugs.po b/bugs.po
index b040a99bb9..2837ebfc0a 100644
--- a/bugs.po
+++ b/bugs.po
@@ -11,7 +11,7 @@
# Steven Hsu , 2021-2022
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-18 19:45+0000\n"
"PO-Revision-Date: 2022-08-31 12:34+0800\n"
diff --git a/c-api/abstract.po b/c-api/abstract.po
index e2ef911a82..87e9a0091e 100644
--- a/c-api/abstract.po
+++ b/c-api/abstract.po
@@ -8,7 +8,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-26 18:54+0800\n"
"PO-Revision-Date: 2021-12-09 21:20+0800\n"
diff --git a/c-api/allocation.po b/c-api/allocation.po
index f167bb99fa..28435d6916 100644
--- a/c-api/allocation.po
+++ b/c-api/allocation.po
@@ -1,5 +1,4 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) 2001-2022, Python Software Foundation
+# Copyright (C) 2001-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
@@ -8,9 +7,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-08-09 00:03+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-"
@@ -29,16 +28,13 @@ msgstr "在 heap 上分配物件"
#: ../../c-api/allocation.rst:17
msgid ""
"Initialize a newly allocated object *op* with its type and initial "
-"reference. Returns the initialized object. If *type* indicates that the "
-"object participates in the cyclic garbage detector, it is added to the "
-"detector's set of observed objects. Other fields of the object are not "
-"affected."
+"reference. Returns the initialized object. Other fields of the object are "
+"not affected."
msgstr ""
-"用它的型別和初始參照來初始化新分配物件 *op*。已初始化的物件會被回傳。如果 "
-"*type* 表示了該物件參與迴圈垃圾檢查器,則將其新增到檢查器的觀察物件集合中。物"
-"件的其他欄位不受影響。"
+"用它的型別和初始參照來初始化新分配物件 *op*。已初始化的物件會被回傳。物件的其"
+"他欄位不受影響。"
-#: ../../c-api/allocation.rst:26
+#: ../../c-api/allocation.rst:24
msgid ""
"This does everything :c:func:`PyObject_Init` does, and also initializes the "
"length information for a variable-size object."
@@ -46,7 +42,7 @@ msgstr ""
"它會做到 :c:func:`PyObject_Init` 的所有功能,並且會初始化一個大小可變物件的長"
"度資訊。"
-#: ../../c-api/allocation.rst:32
+#: ../../c-api/allocation.rst:30
msgid ""
"Allocate a new Python object using the C structure type *TYPE* and the "
"Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the "
@@ -60,7 +56,14 @@ msgstr ""
"化;呼叫者會擁有那個對於物件的唯一參照(物件的參照計數為一)。記憶體分配大小"
"由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位來指定。"
-#: ../../c-api/allocation.rst:43
+#: ../../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 "
@@ -79,7 +82,14 @@ msgstr ""
"於實現如 tuple 這種能夠在建立期間決定自己大小的物件是很實用的。將欄位的陣列嵌"
"入到相同的記憶體分配中可以減少記憶體分配的次數,這提高了記憶體管理的效率。"
-#: ../../c-api/allocation.rst:57
+#: ../../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:"
@@ -92,7 +102,7 @@ msgstr ""
"handler 中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的"
"記憶體已不再是一個有效的 Python 物件。"
-#: ../../c-api/allocation.rst:66
+#: ../../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 "
@@ -101,10 +111,10 @@ msgstr ""
"這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存"
"取,該巨集的拿到指向該物件的指標。"
-#: ../../c-api/allocation.rst:73
+#: ../../c-api/allocation.rst:79
msgid ":c:func:`PyModule_Create`"
msgstr ":c:func:`PyModule_Create`"
-#: ../../c-api/allocation.rst:74
+#: ../../c-api/allocation.rst:80
msgid "To allocate and create extension modules."
msgstr "分配記憶體和建立擴充模組。"
diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po
index 62558d43f5..8b589303e8 100644
--- a/c-api/apiabiversion.po
+++ b/c-api/apiabiversion.po
@@ -6,7 +6,7 @@
# Matt Wang , 2022
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"PO-Revision-Date: 2022-01-24 22:34+0800\n"
diff --git a/c-api/arg.po b/c-api/arg.po
index a8487118c9..921b3bae7f 100644
--- a/c-api/arg.po
+++ b/c-api/arg.po
@@ -1,13 +1,12 @@
-# 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:
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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-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 ""
@@ -55,25 +54,33 @@ msgid ""
"brackets is the type of the C variable(s) whose address should be passed."
msgstr ""
-#: ../../c-api/arg.rst:31
+#: ../../c-api/arg.rst:33
msgid "Strings and buffers"
msgstr ""
-#: ../../c-api/arg.rst:33
+#: ../../c-api/arg.rst:37
+msgid ""
+"On Python 3.12 and older, the macro :c:macro:`!PY_SSIZE_T_CLEAN` must be "
+"defined before including :file:`Python.h` to use all ``#`` variants of "
+"formats (``s#``, ``y#``, etc.) explained below. This is not necessary on "
+"Python 3.13 and later."
+msgstr ""
+
+#: ../../c-api/arg.rst:42
msgid ""
"These formats allow accessing an object as a contiguous chunk of memory. You "
"don't have to provide raw storage for the returned unicode or bytes area."
msgstr ""
-#: ../../c-api/arg.rst:37
+#: ../../c-api/arg.rst:46
msgid "Unless otherwise stated, buffers are not NUL-terminated."
msgstr ""
-#: ../../c-api/arg.rst:39
+#: ../../c-api/arg.rst:48
msgid "There are three ways strings and buffers can be converted to C:"
msgstr ""
-#: ../../c-api/arg.rst:41
+#: ../../c-api/arg.rst:50
msgid ""
"Formats such as ``y*`` and ``s*`` fill a :c:type:`Py_buffer` structure. This "
"locks the underlying buffer so that the caller can subsequently use the "
@@ -83,14 +90,14 @@ msgid ""
"data (or in any early abort case)."
msgstr ""
-#: ../../c-api/arg.rst:48
+#: ../../c-api/arg.rst:57
msgid ""
"The ``es``, ``es#``, ``et`` and ``et#`` formats allocate the result buffer. "
"**You have to call** :c:func:`PyMem_Free` after you have finished processing "
"the data (or in any early abort case)."
msgstr ""
-#: ../../c-api/arg.rst:54
+#: ../../c-api/arg.rst:63
msgid ""
"Other formats take a :class:`str` or a read-only :term:`bytes-like object`, "
"such as :class:`bytes`, and provide a ``const char *`` pointer to its "
@@ -99,7 +106,7 @@ msgid ""
"won't have to release any memory yourself."
msgstr ""
-#: ../../c-api/arg.rst:61
+#: ../../c-api/arg.rst:70
msgid ""
"To ensure that the underlying buffer may be safely borrowed, the object's :c:"
"member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. This "
@@ -107,22 +114,13 @@ msgid ""
"read-only objects such as :class:`memoryview` of :class:`bytes`."
msgstr ""
-#: ../../c-api/arg.rst:67
+#: ../../c-api/arg.rst:76
msgid ""
"Besides this ``bf_releasebuffer`` requirement, there is no check to verify "
"whether the input object is immutable (e.g. whether it would honor a request "
"for a writable buffer, or whether another thread can mutate the data)."
msgstr ""
-#: ../../c-api/arg.rst:73
-msgid ""
-"For all ``#`` variants of formats (``s#``, ``y#``, etc.), the macro :c:macro:"
-"`PY_SSIZE_T_CLEAN` must be defined before including :file:`Python.h`. On "
-"Python 3.9 and older, the type of the length argument is :c:type:"
-"`Py_ssize_t` if the :c:macro:`PY_SSIZE_T_CLEAN` macro is defined, or int "
-"otherwise."
-msgstr ""
-
#: ../../c-api/arg.rst:80
msgid "``s`` (:class:`str`) [const char \\*]"
msgstr "``s`` (:class:`str`) [const char \\*]"
@@ -153,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 ""
@@ -168,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 ""
@@ -178,9 +178,9 @@ msgid ""
"encoding."
msgstr ""
-#: ../../c-api/arg.rst:113 ../../c-api/arg.rst:546
+#: ../../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 ""
@@ -192,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 ""
@@ -205,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 ""
@@ -214,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 ""
@@ -245,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 ""
@@ -288,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 ""
@@ -332,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 ""
@@ -345,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 ""
@@ -368,7 +376,7 @@ msgstr ""
#: ../../c-api/arg.rst:203
msgid "There are two modes of operation:"
-msgstr ""
+msgstr "有兩個操作模式:"
#: ../../c-api/arg.rst:205
msgid ""
@@ -418,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:580
+#: ../../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:574
+#: ../../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:583
+#: ../../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."
@@ -457,57 +486,57 @@ msgstr ""
"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned short int`,轉換過程無溢位檢"
"查。"
-#: ../../c-api/arg.rst:247 ../../c-api/arg.rst:568
+#: ../../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:586
+#: ../../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:577
+#: ../../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:589
+#: ../../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:592
+#: ../../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:595
+#: ../../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."
@@ -515,71 +544,71 @@ msgstr ""
"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long long`,轉換過程無溢位檢"
"查。"
-#: ../../c-api/arg.rst:268 ../../c-api/arg.rst:598
+#: ../../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:605
+#: ../../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:612
+#: ../../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:609
+#: ../../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:618
+#: ../../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:"
@@ -587,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 "
@@ -600,11 +629,11 @@ msgid ""
"required type, :exc:`TypeError` is raised."
msgstr ""
-#: ../../c-api/arg.rst:310 ../../c-api/arg.rst:636
-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 "
@@ -612,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 "
@@ -626,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 "
@@ -652,37 +687,28 @@ msgid ""
"how Python tests values for truth."
msgstr ""
-#: ../../c-api/arg.rst:342 ../../c-api/arg.rst:642
+#: ../../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 "
@@ -691,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 "
@@ -703,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 "
@@ -742,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 "
@@ -752,63 +778,92 @@ 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``-"
-"terminated array of keyword parameter names. Empty names denote :ref:"
-"`positional-only parameters `. Returns true on "
-"success; on failure, it returns false and raises the appropriate exception."
+"parameters into local variables. The *keywords* argument is a ``NULL``-"
+"terminated array of keyword parameter names specified as null-terminated "
+"ASCII or UTF-8 encoded C strings. Empty names denote :ref:`positional-only "
+"parameters `. Returns true on success; on "
+"failure, it returns false and raises the appropriate exception."
+msgstr ""
+
+#: ../../c-api/arg.rst:441
+msgid ""
+"The *keywords* parameter declaration is :c:expr:`char * const *` in C and :c:"
+"expr:`const char * const *` in C++. This can be overridden with the :c:macro:"
+"`PY_CXX_CONST` macro."
msgstr ""
-#: ../../c-api/arg.rst:425
+#: ../../c-api/arg.rst:445
msgid ""
"Added support for :ref:`positional-only parameters `."
+msgstr "新增對\\ :ref:`僅限位置參數 `\\ 的支援。"
+
+#: ../../c-api/arg.rst:449
+msgid ""
+"The *keywords* parameter has now type :c:expr:`char * const *` in C and :c:"
+"expr:`const char * const *` in C++, instead of :c:expr:`char **`. Added "
+"support for non-ASCII keyword parameter names."
msgstr ""
-#: ../../c-api/arg.rst:432
+#: ../../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:438
+#: ../../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:448
+#: ../../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:477
+msgid "Example::"
+msgstr "舉例來說: ::"
+
+#: ../../c-api/arg.rst:479
msgid ""
-"Function used to deconstruct the argument lists of \"old-style\" functions "
-"--- these are functions which use the :const:`METH_OLDARGS` parameter "
-"parsing method, which has been removed in Python 3. This is not recommended "
-"for use in parameter parsing in new code, and most code in the standard "
-"interpreter has been modified to no longer use this for that purpose. It "
-"does remain a convenient way to decompose other tuples, however, and may "
-"continue to be used for that purpose."
+"// Function using METH_O calling convention\n"
+"static PyObject*\n"
+"my_function(PyObject *module, PyObject *arg)\n"
+"{\n"
+" int value;\n"
+" if (!PyArg_Parse(arg, \"i:my_function\", &value)) {\n"
+" return NULL;\n"
+" }\n"
+" // ... use value ...\n"
+"}"
msgstr ""
-#: ../../c-api/arg.rst:459
+#: ../../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 "
@@ -826,13 +881,13 @@ msgid ""
"if there was a failure."
msgstr ""
-#: ../../c-api/arg.rst:474
+#: ../../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:477
+#: ../../c-api/arg.rst:511
msgid ""
"static PyObject *\n"
"weakref_ref(PyObject *self, PyObject *args)\n"
@@ -860,21 +915,30 @@ msgstr ""
" return result;\n"
"}"
-#: ../../c-api/arg.rst:490
+#: ../../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:493
+#: ../../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:498
-msgid "Building values"
+#: ../../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` "
+"and :c:func:`PyArg_VaParseTupleAndKeywords`. Default empty for C and "
+"``const`` for C++ (:c:expr:`const char * const *`). To override, define it "
+"to the desired value before including :file:`Python.h`."
msgstr ""
-#: ../../c-api/arg.rst:502
+#: ../../c-api/arg.rst:545
+msgid "Building values"
+msgstr "建置數值"
+
+#: ../../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 "
@@ -882,7 +946,7 @@ msgid ""
"``NULL`` is returned."
msgstr ""
-#: ../../c-api/arg.rst:507
+#: ../../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 "
@@ -891,7 +955,7 @@ msgid ""
"it to return a tuple of size 0 or one, parenthesize the format string."
msgstr ""
-#: ../../c-api/arg.rst:513
+#: ../../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. "
@@ -902,7 +966,7 @@ msgid ""
"`Py_BuildValue` returns."
msgstr ""
-#: ../../c-api/arg.rst:521
+#: ../../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 "
@@ -910,155 +974,155 @@ msgid ""
"be passed."
msgstr ""
-#: ../../c-api/arg.rst:525
+#: ../../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:529
+#: ../../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:530
+#: ../../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:533
+#: ../../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:534
+#: ../../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:538
+#: ../../c-api/arg.rst:585
msgid "``y`` (:class:`bytes`) [const char \\*]"
msgstr "``y`` (:class:`bytes`) [const char \\*]"
-#: ../../c-api/arg.rst:539
+#: ../../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:542
+#: ../../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:543
+#: ../../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:547 ../../c-api/arg.rst:563
+#: ../../c-api/arg.rst:594 ../../c-api/arg.rst:610
msgid "Same as ``s``."
msgstr "和 ``s`` 相同。"
-#: ../../c-api/arg.rst:549
+#: ../../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:550 ../../c-api/arg.rst:566
+#: ../../c-api/arg.rst:597 ../../c-api/arg.rst:613
msgid "Same as ``s#``."
msgstr "和 ``s#`` 相同。"
-#: ../../c-api/arg.rst:552
+#: ../../c-api/arg.rst:599
msgid "``u`` (:class:`str`) [const wchar_t \\*]"
msgstr "``u`` (:class:`str`) [const wchar_t \\*]"
-#: ../../c-api/arg.rst:553
+#: ../../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:557
+#: ../../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:558
+#: ../../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:562
+#: ../../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:565
+#: ../../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:569
+#: ../../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:571
+#: ../../c-api/arg.rst:618
msgid "``b`` (:class:`int`) [char]"
msgstr "``b`` (:class:`int`) [char]"
-#: ../../c-api/arg.rst:572
+#: ../../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:575
+#: ../../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:578
+#: ../../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:581
+#: ../../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:584
+#: ../../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:587
+#: ../../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:590
+#: ../../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:593
+#: ../../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:596
+#: ../../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:599
+#: ../../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:601
+#: ../../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:602
+#: ../../c-api/arg.rst:651
msgid ""
"Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` "
"object of length 1."
@@ -1066,7 +1130,7 @@ msgstr ""
"將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:"
"`bytes`。"
-#: ../../c-api/arg.rst:606
+#: ../../c-api/arg.rst:655
msgid ""
"Convert a C :c:expr:`int` representing a character to Python :class:`str` "
"object of length 1."
@@ -1074,23 +1138,23 @@ msgstr ""
"將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:"
"`str`。"
-#: ../../c-api/arg.rst:610
+#: ../../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:613
+#: ../../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:615
+#: ../../c-api/arg.rst:664
msgid "``D`` (:class:`complex`) [Py_complex \\*]"
msgstr "``D`` (:class:`complex`) [Py_complex \\*]"
-#: ../../c-api/arg.rst:616
+#: ../../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:619
+#: ../../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 "
@@ -1100,26 +1164,30 @@ msgid ""
"no exception has been raised yet, :exc:`SystemError` is set."
msgstr ""
-#: ../../c-api/arg.rst:628
+#: ../../c-api/arg.rst:677
msgid "``S`` (object) [PyObject \\*]"
-msgstr "``S``\\ (物件)[PyObject \\*]"
+msgstr "``S`` (object) [PyObject \\*]"
-#: ../../c-api/arg.rst:629
+#: ../../c-api/arg.rst:678
msgid "Same as ``O``."
msgstr "和 ``O`` 相同。"
-#: ../../c-api/arg.rst:631
+#: ../../c-api/arg.rst:680
msgid "``N`` (object) [PyObject \\*]"
-msgstr "``N``\\ (物件)[PyObject \\*]"
+msgstr "``N`` (object) [PyObject \\*]"
-#: ../../c-api/arg.rst:632
+#: ../../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:637
+#: ../../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:"
@@ -1127,40 +1195,40 @@ msgid ""
"``NULL`` if an error occurred."
msgstr ""
-#: ../../c-api/arg.rst:643
+#: ../../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:645
+#: ../../c-api/arg.rst:694
msgid "``[items]`` (:class:`list`) [*matching-items*]"
msgstr "``[items]`` (:class:`list`) [*matching-items*]"
-#: ../../c-api/arg.rst:646
+#: ../../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:648
+#: ../../c-api/arg.rst:697
msgid "``{items}`` (:class:`dict`) [*matching-items*]"
msgstr "``{items}`` (:class:`dict`) [*matching-items*]"
-#: ../../c-api/arg.rst:649
+#: ../../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:653
+#: ../../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:658
+#: ../../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/bool.po b/c-api/bool.po
index d90772c4a7..9a057a6678 100644
--- a/c-api/bool.po
+++ b/c-api/bool.po
@@ -8,9 +8,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-07-29 10:36+0000\n"
+"POT-Creation-Date: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2021-12-09 20:47+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -52,27 +52,26 @@ msgstr ""
#: ../../c-api/bool.rst:28
msgid ""
-"The Python ``False`` object. This object has no methods and is `immortal "
-"`_."
+"The Python ``False`` object. This object has no methods and is :term:"
+"`immortal`."
msgstr ""
-"Python 的 ``False`` 物件。此物件沒有任何方法且為\\ `不滅的 (immortal) "
-"`_。"
+"Python 的 ``False`` 物件。此物件沒有任何方法且為\\ :term:`不滅的 (immortal) "
+"`。"
#: ../../c-api/bool.rst:31
-msgid ":c:data:`Py_False` is immortal."
-msgstr ":c:data:`Py_False` 為不滅的。"
+msgid ":c:data:`Py_False` is :term:`immortal`."
+msgstr ":c:data:`Py_False` 為\\ :term:`不滅的 `。"
#: ../../c-api/bool.rst:37
msgid ""
-"The Python ``True`` object. This object has no methods and is `immortal "
-"`_."
+"The Python ``True`` object. This object has no methods and is :term:"
+"`immortal`."
msgstr ""
-"Python 的 ``True`` 物件。此物件沒有任何方法且為\\ `不滅的 (immortal) "
-"`_。"
+"Python 的 ``True`` 物件。此物件沒有任何方法且為\\ :term:`不滅的 `。"
#: ../../c-api/bool.rst:40
-msgid ":c:data:`Py_True` is immortal."
-msgstr ":c:data:`Py_True` 為不滅的。"
+msgid ":c:data:`Py_True` is :term:`immortal`."
+msgstr ":c:data:`Py_True` 為\\ :term:`不滅的 `。"
#: ../../c-api/bool.rst:46
msgid "Return :c:data:`Py_False` from a function."
diff --git a/c-api/buffer.po b/c-api/buffer.po
index 7d80cf51b9..5248994757 100644
--- a/c-api/buffer.po
+++ b/c-api/buffer.po
@@ -5,9 +5,9 @@
# Translators:
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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-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,25 +349,26 @@ msgid ""
"itemsize`, :c:member:`~Py_buffer.ndim`."
msgstr ""
-#: ../../c-api/buffer.rst:249
+#: ../../c-api/buffer.rst:254
msgid "readonly, format"
msgstr ""
-#: ../../c-api/buffer.rst:253
+#: ../../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 "
"exporter MAY provide either a read-only or writable buffer, but the choice "
-"MUST be consistent for all consumers."
+"MUST be consistent for all consumers. For example, :c:expr:`PyBUF_SIMPLE | "
+"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:"
@@ -367,158 +376,159 @@ msgid ""
"writable buffer."
msgstr ""
-#: ../../c-api/buffer.rst:268
+#: ../../c-api/buffer.rst:274
msgid ""
-":c:macro:`PyBUF_FORMAT` can be \\|'d to any of the flags except :c:macro:"
-"`PyBUF_SIMPLE`. The latter already implies format ``B`` (unsigned bytes)."
+":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:273
+#: ../../c-api/buffer.rst:280
msgid "shape, strides, suboffsets"
msgstr ""
-#: ../../c-api/buffer.rst:275
+#: ../../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:282 ../../c-api/buffer.rst:306
-#: ../../c-api/buffer.rst:331
+#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313
+#: ../../c-api/buffer.rst:338
msgid "Request"
msgstr ""
-#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306
-#: ../../c-api/buffer.rst:331
+#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313
+#: ../../c-api/buffer.rst:338
msgid "shape"
msgstr ""
-#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306
-#: ../../c-api/buffer.rst:331
+#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313
+#: ../../c-api/buffer.rst:338
msgid "strides"
msgstr ""
-#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306
-#: ../../c-api/buffer.rst:331
+#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313
+#: ../../c-api/buffer.rst:338
msgid "suboffsets"
msgstr ""
-#: ../../c-api/buffer.rst:284 ../../c-api/buffer.rst:286
-#: ../../c-api/buffer.rst:288 ../../c-api/buffer.rst:308
-#: ../../c-api/buffer.rst:310 ../../c-api/buffer.rst:312
-#: ../../c-api/buffer.rst:314 ../../c-api/buffer.rst:333
-#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:337
-#: ../../c-api/buffer.rst:339 ../../c-api/buffer.rst:341
-#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:345
-#: ../../c-api/buffer.rst:347
+#: ../../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:284 ../../c-api/buffer.rst:333
-#: ../../c-api/buffer.rst:335
+#: ../../c-api/buffer.rst:291 ../../c-api/buffer.rst:340
+#: ../../c-api/buffer.rst:342
msgid "if needed"
msgstr ""
-#: ../../c-api/buffer.rst:286 ../../c-api/buffer.rst:288
-#: ../../c-api/buffer.rst:290 ../../c-api/buffer.rst:308
-#: ../../c-api/buffer.rst:310 ../../c-api/buffer.rst:312
-#: ../../c-api/buffer.rst:314 ../../c-api/buffer.rst:337
-#: ../../c-api/buffer.rst:339 ../../c-api/buffer.rst:341
-#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:345
-#: ../../c-api/buffer.rst:347
+#: ../../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:297
+#: ../../c-api/buffer.rst:304
msgid "contiguity requests"
msgstr ""
-#: ../../c-api/buffer.rst:299
+#: ../../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:306 ../../c-api/buffer.rst:331
+#: ../../c-api/buffer.rst:313 ../../c-api/buffer.rst:338
msgid "contig"
msgstr ""
-#: ../../c-api/buffer.rst:308 ../../c-api/buffer.rst:314
-#: ../../c-api/buffer.rst:345 ../../c-api/buffer.rst:347
+#: ../../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:310
+#: ../../c-api/buffer.rst:317
msgid "F"
msgstr "F"
-#: ../../c-api/buffer.rst:312
+#: ../../c-api/buffer.rst:319
msgid "C or F"
msgstr "C 或 F"
-#: ../../c-api/buffer.rst:314
+#: ../../c-api/buffer.rst:321
msgid ":c:macro:`PyBUF_ND`"
msgstr ":c:macro:`PyBUF_ND`"
-#: ../../c-api/buffer.rst:319
+#: ../../c-api/buffer.rst:326
msgid "compound requests"
msgstr ""
-#: ../../c-api/buffer.rst:321
+#: ../../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:325
+#: ../../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:331
+#: ../../c-api/buffer.rst:338
msgid "readonly"
msgstr ""
-#: ../../c-api/buffer.rst:331
+#: ../../c-api/buffer.rst:338
msgid "format"
msgstr ""
-#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335
-#: ../../c-api/buffer.rst:337 ../../c-api/buffer.rst:339
-#: ../../c-api/buffer.rst:341 ../../c-api/buffer.rst:343
+#: ../../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:333 ../../c-api/buffer.rst:337
-#: ../../c-api/buffer.rst:341 ../../c-api/buffer.rst:345
+#: ../../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:335 ../../c-api/buffer.rst:339
-#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:347
+#: ../../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:352
+#: ../../c-api/buffer.rst:359
msgid "Complex arrays"
msgstr ""
-#: ../../c-api/buffer.rst:355
+#: ../../c-api/buffer.rst:362
msgid "NumPy-style: shape and strides"
msgstr ""
-#: ../../c-api/buffer.rst:357
+#: ../../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:360
+#: ../../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 "
@@ -526,14 +536,14 @@ msgid ""
"strides` are ``NULL``."
msgstr ""
-#: ../../c-api/buffer.rst:364
+#: ../../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:368
+#: ../../c-api/buffer.rst:375
msgid ""
"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * "
"strides[n-1];\n"
@@ -543,14 +553,14 @@ msgstr ""
"strides[n-1];\n"
"item = *((typeof(item) *)ptr);"
-#: ../../c-api/buffer.rst:374
+#: ../../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:378
+#: ../../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"
@@ -579,11 +589,11 @@ msgid ""
" return 0 <= offset+imin and offset+imax+itemsize <= memlen"
msgstr ""
-#: ../../c-api/buffer.rst:408
+#: ../../c-api/buffer.rst:415
msgid "PIL-style: shape, strides and suboffsets"
msgstr ""
-#: ../../c-api/buffer.rst:410
+#: ../../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 "
@@ -594,14 +604,14 @@ msgid ""
"x[2][3]`` arrays that can be located anywhere in memory."
msgstr ""
-#: ../../c-api/buffer.rst:419
+#: ../../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:423
+#: ../../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"
@@ -629,25 +639,25 @@ msgstr ""
" return (void*)pointer;\n"
"}"
-#: ../../c-api/buffer.rst:438
+#: ../../c-api/buffer.rst:445
msgid "Buffer-related functions"
msgstr ""
-#: ../../c-api/buffer.rst:442
+#: ../../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:449
+#: ../../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:454
+#: ../../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 "
@@ -655,7 +665,7 @@ msgid ""
"instead of *exporter* (See :ref:`Buffer Object Structures `)."
msgstr ""
-#: ../../c-api/buffer.rst:459
+#: ../../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:"
@@ -663,7 +673,7 @@ msgid ""
"`PyBuffer_Release` must be called exactly once."
msgstr ""
-#: ../../c-api/buffer.rst:467
+#: ../../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-"
@@ -671,19 +681,19 @@ msgid ""
"used, otherwise reference leaks may occur."
msgstr ""
-#: ../../c-api/buffer.rst:472
+#: ../../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:478
+#: ../../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:486
+#: ../../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 "
@@ -691,69 +701,69 @@ msgid ""
"succeeds."
msgstr ""
-#: ../../c-api/buffer.rst:493
+#: ../../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:499
+#: ../../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:506
+#: ../../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:510
+#: ../../c-api/buffer.rst:517
msgid "This function fails if *len* != *src->len*."
msgstr ""
-#: ../../c-api/buffer.rst:515
+#: ../../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:518
+#: ../../c-api/buffer.rst:525
msgid "``0`` is returned on success, ``-1`` on error."
msgstr ""
-#: ../../c-api/buffer.rst:522
+#: ../../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:529
+#: ../../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:533
+#: ../../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:537
+#: ../../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:541
+#: ../../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 "
@@ -780,14 +790,14 @@ msgstr "buffer object(緩衝物件)"
msgid "PyBufferProcs (C type)"
msgstr "PyBufferProcs(C 型別)"
-#: ../../c-api/buffer.rst:294
+#: ../../c-api/buffer.rst:301
msgid "contiguous"
msgstr "contiguous(連續的)"
-#: ../../c-api/buffer.rst:294
+#: ../../c-api/buffer.rst:301
msgid "C-contiguous"
msgstr "C-contiguous(C 連續的)"
-#: ../../c-api/buffer.rst:294
+#: ../../c-api/buffer.rst:301
msgid "Fortran contiguous"
msgstr "Fortran contiguous(Fortran 連續的)"
diff --git a/c-api/bytearray.po b/c-api/bytearray.po
index b99829a933..57d7d62324 100644
--- a/c-api/bytearray.po
+++ b/c-api/bytearray.po
@@ -5,7 +5,7 @@
# Translators:
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-04 00:03+0000\n"
"PO-Revision-Date: 2023-08-12 11:42+0800\n"
diff --git a/c-api/bytes.po b/c-api/bytes.po
index e70159eeb0..4cb4ac8545 100644
--- a/c-api/bytes.po
+++ b/c-api/bytes.po
@@ -5,9 +5,9 @@
# Translators:
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-12-26 00:03+0000\n"
+"POT-Creation-Date: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2018-05-23 14:04+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -316,16 +316,14 @@ msgstr ""
#: ../../c-api/bytes.rst:194
msgid ""
-"A way to resize a bytes object even though it is \"immutable\". Only use "
-"this to build up a brand new bytes object; don't use this if the bytes may "
-"already be known in other parts of the code. It is an error to call this "
-"function if the refcount on the input bytes object is not one. Pass the "
-"address of an existing bytes object as an lvalue (it may be written into), "
-"and the new size desired. On success, *\\*bytes* holds the resized bytes "
-"object and ``0`` is returned; the address in *\\*bytes* may differ from its "
-"input value. If the reallocation fails, the original bytes object at "
-"*\\*bytes* is deallocated, *\\*bytes* is set to ``NULL``, :exc:`MemoryError` "
-"is set, and ``-1`` is returned."
+"Resize a bytes object. *newsize* will be the new length of the bytes object. "
+"You can think of it as creating a new bytes object and destroying the old "
+"one, only more efficiently. Pass the address of an existing bytes object as "
+"an lvalue (it may be written into), and the new size desired. On success, "
+"*\\*bytes* holds the resized bytes object and ``0`` is returned; the address "
+"in *\\*bytes* may differ from its input value. If the reallocation fails, "
+"the original bytes object at *\\*bytes* is deallocated, *\\*bytes* is set to "
+"``NULL``, :exc:`MemoryError` is set, and ``-1`` is returned."
msgstr ""
#: ../../c-api/bytes.rst:11
diff --git a/c-api/call.po b/c-api/call.po
index 481a78e876..4f635027c2 100644
--- a/c-api/call.po
+++ b/c-api/call.po
@@ -6,9 +6,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2022-10-16 03:20+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -227,30 +227,11 @@ msgstr ""
"要呼叫一個實作了 vectorcall 的物件,請就像其他可呼叫物件一樣使用\\ :ref:`呼"
"叫 API` 中的函式。:c:func:`PyObject_Vectorcall` 通常是最有效率的。"
-#: ../../c-api/call.rst:120
-msgid ""
-"In CPython 3.8, the vectorcall API and related functions were available "
-"provisionally under names with a leading underscore: "
-"``_PyObject_Vectorcall``, ``_Py_TPFLAGS_HAVE_VECTORCALL``, "
-"``_PyObject_VectorcallMethod``, ``_PyVectorcall_Function``, "
-"``_PyObject_CallOneArg``, ``_PyObject_CallMethodNoArgs``, "
-"``_PyObject_CallMethodOneArg``. Additionally, ``PyObject_VectorcallDict`` "
-"was available as ``_PyObject_FastCallDict``. The old names are still defined "
-"as aliases of the new, non-underscored names."
-msgstr ""
-"在 CPython 3.8 中,vectorcall API 和相關函式暫定以帶開頭底線的名稱提供:"
-"``_PyObject_Vectorcall``、``_Py_TPFLAGS_HAVE_VECTORCALL``、"
-"``_PyObject_VectorcallMethod``、``_PyVectorcall_Function``、"
-"``_PyObject_CallOneArg``、``_PyObject_CallMethodNoArgs``、"
-"``_PyObject_CallMethodOneArg``。此外,``PyObject_VectorcallDict`` 也以 "
-"``_PyObject_FastCallDict`` 名稱提供。這些舊名稱仍有被定義,做為不帶底線的新名"
-"稱的別名。"
-
-#: ../../c-api/call.rst:132
+#: ../../c-api/call.rst:119
msgid "Recursion Control"
msgstr "遞迴控制"
-#: ../../c-api/call.rst:134
+#: ../../c-api/call.rst:121
msgid ""
"When using *tp_call*, callees do not need to worry about :ref:`recursion "
"`: CPython uses :c:func:`Py_EnterRecursiveCall` and :c:func:"
@@ -260,7 +241,7 @@ msgstr ""
"使用 *tp_call* 的呼叫會使用 :c:func:`Py_EnterRecursiveCall` 和 :c:func:"
"`Py_LeaveRecursiveCall`。"
-#: ../../c-api/call.rst:139
+#: ../../c-api/call.rst:126
msgid ""
"For efficiency, this is not the case for calls done using vectorcall: the "
"callee should use *Py_EnterRecursiveCall* and *Py_LeaveRecursiveCall* if "
@@ -269,27 +250,27 @@ msgstr ""
"為保證效率,這不適用於使用 vectorcall 的呼叫:被呼叫方在需要時應當使用 "
"*Py_EnterRecursiveCall* 和 *Py_LeaveRecursiveCall*。"
-#: ../../c-api/call.rst:145
+#: ../../c-api/call.rst:132
msgid "Vectorcall Support API"
msgstr "Vectorcall 支援 API"
-#: ../../c-api/call.rst:149
+#: ../../c-api/call.rst:136
msgid ""
"Given a vectorcall *nargsf* argument, return the actual number of arguments. "
"Currently equivalent to::"
msgstr "給定一個 vectorcall *nargsf* 引數,回傳引數的實際數量。目前等同於: ::"
-#: ../../c-api/call.rst:153
+#: ../../c-api/call.rst:140
msgid "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)"
msgstr "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)"
-#: ../../c-api/call.rst:155
+#: ../../c-api/call.rst:142
msgid ""
"However, the function ``PyVectorcall_NARGS`` should be used to allow for "
"future extensions."
msgstr "然而,應使用 ``PyVectorcall_NARGS`` 函式以便將來需要擴充。"
-#: ../../c-api/call.rst:162
+#: ../../c-api/call.rst:149
msgid ""
"If *op* does not support the vectorcall protocol (either because the type "
"does not or because the specific instance does not), return *NULL*. "
@@ -300,7 +281,7 @@ msgstr ""
"*NULL*。否則,回傳儲存在 *op* 中的 vectorcall 函式指標。這個函式不會引發例"
"外。"
-#: ../../c-api/call.rst:167
+#: ../../c-api/call.rst:154
msgid ""
"This is mostly useful to check whether or not *op* supports vectorcall, "
"which can be done by checking ``PyVectorcall_Function(op) != NULL``."
@@ -308,7 +289,7 @@ msgstr ""
"這大多在檢查 *op* 是否支援 vectorcall 時能派上用場,可以透過檢查 "
"``PyVectorcall_Function(op) != NULL`` 來達成。"
-#: ../../c-api/call.rst:174
+#: ../../c-api/call.rst:161
msgid ""
"Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword "
"arguments given in a tuple and dict, respectively."
@@ -316,7 +297,7 @@ msgstr ""
"呼叫 *callable* 的 :c:type:`vectorcallfunc`,其位置引數和關鍵字引數分別以 "
"tuple 和 dict 格式給定。"
-#: ../../c-api/call.rst:177
+#: ../../c-api/call.rst:164
msgid ""
"This is a specialized function, intended to be put in the :c:member:"
"`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. "
@@ -327,11 +308,11 @@ msgstr ""
"用於 ``tp_call`` 的實作。它不會檢查 :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` 旗"
"標並且它不會退回 (fall back) 使用 ``tp_call``。"
-#: ../../c-api/call.rst:188
+#: ../../c-api/call.rst:175
msgid "Object Calling API"
msgstr "物件呼叫 API"
-#: ../../c-api/call.rst:190
+#: ../../c-api/call.rst:177
msgid ""
"Various functions are available for calling a Python object. Each converts "
"its arguments to a convention supported by the called object – either "
@@ -342,133 +323,133 @@ msgstr ""
"的慣用形式 – 可以是 *tp_call* 或 vectorcall。為了儘可能減少轉換的進行,請選擇"
"一個適合你所擁有資料格式的函式。"
-#: ../../c-api/call.rst:196
+#: ../../c-api/call.rst:183
msgid ""
"The following table summarizes the available functions; please see "
"individual documentation for details."
msgstr "下表總結了可用的函式;請參閱各個說明文件以瞭解詳情。"
-#: ../../c-api/call.rst:200
+#: ../../c-api/call.rst:187
msgid "Function"
msgstr "函式"
-#: ../../c-api/call.rst:200
+#: ../../c-api/call.rst:187
msgid "callable"
msgstr "callable"
-#: ../../c-api/call.rst:200
+#: ../../c-api/call.rst:187
msgid "args"
msgstr "args"
-#: ../../c-api/call.rst:200
+#: ../../c-api/call.rst:187
msgid "kwargs"
msgstr "kwargs"
-#: ../../c-api/call.rst:202
+#: ../../c-api/call.rst:189
msgid ":c:func:`PyObject_Call`"
msgstr ":c:func:`PyObject_Call`"
-#: ../../c-api/call.rst:202 ../../c-api/call.rst:204 ../../c-api/call.rst:206
-#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 ../../c-api/call.rst:214
-#: ../../c-api/call.rst:222 ../../c-api/call.rst:224
+#: ../../c-api/call.rst:189 ../../c-api/call.rst:191 ../../c-api/call.rst:193
+#: ../../c-api/call.rst:195 ../../c-api/call.rst:197 ../../c-api/call.rst:201
+#: ../../c-api/call.rst:209 ../../c-api/call.rst:211
msgid "``PyObject *``"
msgstr "``PyObject *``"
-#: ../../c-api/call.rst:202
+#: ../../c-api/call.rst:189
msgid "tuple"
msgstr "tuple"
-#: ../../c-api/call.rst:202 ../../c-api/call.rst:224
+#: ../../c-api/call.rst:189 ../../c-api/call.rst:211
msgid "dict/``NULL``"
msgstr "dict/``NULL``"
-#: ../../c-api/call.rst:204
+#: ../../c-api/call.rst:191
msgid ":c:func:`PyObject_CallNoArgs`"
msgstr ":c:func:`PyObject_CallNoArgs`"
-#: ../../c-api/call.rst:204 ../../c-api/call.rst:206 ../../c-api/call.rst:208
-#: ../../c-api/call.rst:210 ../../c-api/call.rst:212 ../../c-api/call.rst:214
-#: ../../c-api/call.rst:216 ../../c-api/call.rst:218 ../../c-api/call.rst:220
+#: ../../c-api/call.rst:191 ../../c-api/call.rst:193 ../../c-api/call.rst:195
+#: ../../c-api/call.rst:197 ../../c-api/call.rst:199 ../../c-api/call.rst:201
+#: ../../c-api/call.rst:203 ../../c-api/call.rst:205 ../../c-api/call.rst:207
msgid "---"
msgstr "---"
-#: ../../c-api/call.rst:206
+#: ../../c-api/call.rst:193
msgid ":c:func:`PyObject_CallOneArg`"
msgstr ":c:func:`PyObject_CallOneArg`"
-#: ../../c-api/call.rst:206 ../../c-api/call.rst:220
+#: ../../c-api/call.rst:193 ../../c-api/call.rst:207
msgid "1 object"
msgstr "一個物件"
-#: ../../c-api/call.rst:208
+#: ../../c-api/call.rst:195
msgid ":c:func:`PyObject_CallObject`"
msgstr ":c:func:`PyObject_CallObject`"
-#: ../../c-api/call.rst:208
+#: ../../c-api/call.rst:195
msgid "tuple/``NULL``"
msgstr "tuple/``NULL``"
-#: ../../c-api/call.rst:210
+#: ../../c-api/call.rst:197
msgid ":c:func:`PyObject_CallFunction`"
msgstr ":c:func:`PyObject_CallFunction`"
-#: ../../c-api/call.rst:210 ../../c-api/call.rst:212
+#: ../../c-api/call.rst:197 ../../c-api/call.rst:199
msgid "format"
msgstr "format"
-#: ../../c-api/call.rst:212
+#: ../../c-api/call.rst:199
msgid ":c:func:`PyObject_CallMethod`"
msgstr ":c:func:`PyObject_CallMethod`"
-#: ../../c-api/call.rst:212
+#: ../../c-api/call.rst:199
msgid "obj + ``char*``"
msgstr "物件 + ``char*``"
-#: ../../c-api/call.rst:214
+#: ../../c-api/call.rst:201
msgid ":c:func:`PyObject_CallFunctionObjArgs`"
msgstr ":c:func:`PyObject_CallFunctionObjArgs`"
-#: ../../c-api/call.rst:214 ../../c-api/call.rst:216
+#: ../../c-api/call.rst:201 ../../c-api/call.rst:203
msgid "variadic"
msgstr "可變引數"
-#: ../../c-api/call.rst:216
+#: ../../c-api/call.rst:203
msgid ":c:func:`PyObject_CallMethodObjArgs`"
msgstr ":c:func:`PyObject_CallMethodObjArgs`"
-#: ../../c-api/call.rst:216 ../../c-api/call.rst:218 ../../c-api/call.rst:220
+#: ../../c-api/call.rst:203 ../../c-api/call.rst:205 ../../c-api/call.rst:207
msgid "obj + name"
msgstr "物件 + 名稱"
-#: ../../c-api/call.rst:218
+#: ../../c-api/call.rst:205
msgid ":c:func:`PyObject_CallMethodNoArgs`"
msgstr ":c:func:`PyObject_CallMethodNoArgs`"
-#: ../../c-api/call.rst:220
+#: ../../c-api/call.rst:207
msgid ":c:func:`PyObject_CallMethodOneArg`"
msgstr ":c:func:`PyObject_CallMethodOneArg`"
-#: ../../c-api/call.rst:222
+#: ../../c-api/call.rst:209
msgid ":c:func:`PyObject_Vectorcall`"
msgstr ":c:func:`PyObject_Vectorcall`"
-#: ../../c-api/call.rst:222 ../../c-api/call.rst:224 ../../c-api/call.rst:226
+#: ../../c-api/call.rst:209 ../../c-api/call.rst:211 ../../c-api/call.rst:213
msgid "vectorcall"
msgstr "vectorcall"
-#: ../../c-api/call.rst:224
+#: ../../c-api/call.rst:211
msgid ":c:func:`PyObject_VectorcallDict`"
msgstr ":c:func:`PyObject_VectorcallDict`"
-#: ../../c-api/call.rst:226
+#: ../../c-api/call.rst:213
msgid ":c:func:`PyObject_VectorcallMethod`"
msgstr ":c:func:`PyObject_VectorcallMethod`"
-#: ../../c-api/call.rst:226
+#: ../../c-api/call.rst:213
msgid "arg + name"
msgstr "引數 + 名稱"
-#: ../../c-api/call.rst:232
+#: ../../c-api/call.rst:219
msgid ""
"Call a callable Python object *callable*, with arguments given by the tuple "
"*args*, and named arguments given by the dictionary *kwargs*."
@@ -476,7 +457,7 @@ msgstr ""
"呼叫一個可呼叫的 Python 物件 *callable*,附帶由 tuple *args* 所給定的引數及由"
"字典 *kwargs* 所給定的關鍵字引數。"
-#: ../../c-api/call.rst:235
+#: ../../c-api/call.rst:222
msgid ""
"*args* must not be *NULL*; use an empty tuple if no arguments are needed. If "
"no named arguments are needed, *kwargs* can be *NULL*."
@@ -484,22 +465,22 @@ msgstr ""
"*args* 必須不為 *NULL*;如果不需要引數,請使用一個空 tuple。如果不需要關鍵字"
"引數,則 *kwargs* 可以為 *NULL*。"
-#: ../../c-api/call.rst:238 ../../c-api/call.rst:250 ../../c-api/call.rst:261
-#: ../../c-api/call.rst:272 ../../c-api/call.rst:284 ../../c-api/call.rst:304
-#: ../../c-api/call.rst:323 ../../c-api/call.rst:337 ../../c-api/call.rst:346
-#: ../../c-api/call.rst:358 ../../c-api/call.rst:371 ../../c-api/call.rst:405
+#: ../../c-api/call.rst:225 ../../c-api/call.rst:237 ../../c-api/call.rst:248
+#: ../../c-api/call.rst:259 ../../c-api/call.rst:271 ../../c-api/call.rst:291
+#: ../../c-api/call.rst:310 ../../c-api/call.rst:324 ../../c-api/call.rst:333
+#: ../../c-api/call.rst:345 ../../c-api/call.rst:358 ../../c-api/call.rst:392
msgid ""
"Return the result of the call on success, or raise an exception and return "
"*NULL* on failure."
msgstr "成功時回傳結果,或在失敗時引發一個例外並回傳 *NULL*。"
-#: ../../c-api/call.rst:241
+#: ../../c-api/call.rst:228
msgid ""
"This is the equivalent of the Python expression: ``callable(*args, "
"**kwargs)``."
msgstr "這等價於 Python 運算式 ``callable(*args, **kwargs)``。"
-#: ../../c-api/call.rst:247
+#: ../../c-api/call.rst:234
msgid ""
"Call a callable Python object *callable* without any arguments. It is the "
"most efficient way to call a callable Python object without any argument."
@@ -507,7 +488,7 @@ msgstr ""
"呼叫一個可呼叫的 Python 物件 *callable* 並不附帶任何引數。這是不帶引數呼叫 "
"Python 可呼叫物件的最有效方式。"
-#: ../../c-api/call.rst:258
+#: ../../c-api/call.rst:245
msgid ""
"Call a callable Python object *callable* with exactly 1 positional argument "
"*arg* and no keyword arguments."
@@ -515,7 +496,7 @@ msgstr ""
"呼叫一個可呼叫的 Python 物件 *callable* 並附帶正好一個位置引數 *arg* 而沒有關"
"鍵字引數。"
-#: ../../c-api/call.rst:269
+#: ../../c-api/call.rst:256
msgid ""
"Call a callable Python object *callable*, with arguments given by the tuple "
"*args*. If no arguments are needed, then *args* can be *NULL*."
@@ -523,11 +504,11 @@ msgstr ""
"呼叫一個可呼叫的 Python 物件 *callable*,附帶由 tuple *args* 所給定的引數。如"
"果不需要傳入引數,則 *args* 可以為 *NULL*。"
-#: ../../c-api/call.rst:275 ../../c-api/call.rst:287
+#: ../../c-api/call.rst:262 ../../c-api/call.rst:274
msgid "This is the equivalent of the Python expression: ``callable(*args)``."
msgstr "這等價於 Python 運算式 ``callable(*args)``。"
-#: ../../c-api/call.rst:280
+#: ../../c-api/call.rst:267
msgid ""
"Call a callable Python object *callable*, with a variable number of C "
"arguments. The C arguments are described using a :c:func:`Py_BuildValue` "
@@ -538,7 +519,7 @@ msgstr ""
"用 :c:func:`Py_BuildValue` 風格的格式字串來描述。格式可以為 *NULL*,表示沒有"
"提供任何引數。"
-#: ../../c-api/call.rst:289
+#: ../../c-api/call.rst:276
msgid ""
"Note that if you only pass :c:expr:`PyObject *` args, :c:func:"
"`PyObject_CallFunctionObjArgs` is a faster alternative."
@@ -546,11 +527,11 @@ msgstr ""
"注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:"
"`PyObject_CallFunctionObjArgs` 是另一個更快速的選擇。"
-#: ../../c-api/call.rst:292
+#: ../../c-api/call.rst:279
msgid "The type of *format* was changed from ``char *``."
msgstr "這個 *format* 的型別已從 ``char *`` 更改。"
-#: ../../c-api/call.rst:298
+#: ../../c-api/call.rst:285
msgid ""
"Call the method named *name* of object *obj* with a variable number of C "
"arguments. The C arguments are described by a :c:func:`Py_BuildValue` "
@@ -559,17 +540,17 @@ msgstr ""
"呼叫 *obj* 物件中名為 *name* 的 method 並附帶數量可變的 C 引數。這些 C 引數"
"由 :c:func:`Py_BuildValue` 格式字串來描述,並應當生成一個 tuple。"
-#: ../../c-api/call.rst:302
+#: ../../c-api/call.rst:289
msgid "The format can be *NULL*, indicating that no arguments are provided."
msgstr "格式可以為 *NULL*,表示沒有提供任何引數。"
-#: ../../c-api/call.rst:307
+#: ../../c-api/call.rst:294
msgid ""
"This is the equivalent of the Python expression: ``obj.name(arg1, "
"arg2, ...)``."
msgstr "這等價於 Python 運算式 ``obj.name(arg1, arg2, ...)``。"
-#: ../../c-api/call.rst:310
+#: ../../c-api/call.rst:297
msgid ""
"Note that if you only pass :c:expr:`PyObject *` args, :c:func:"
"`PyObject_CallMethodObjArgs` is a faster alternative."
@@ -577,11 +558,11 @@ msgstr ""
"注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:"
"`PyObject_CallMethodObjArgs` 是另一個更快速的選擇。"
-#: ../../c-api/call.rst:313
+#: ../../c-api/call.rst:300
msgid "The types of *name* and *format* were changed from ``char *``."
msgstr "*name* 和 *format* 的型別已從 ``char *`` 更改。"
-#: ../../c-api/call.rst:319
+#: ../../c-api/call.rst:306
msgid ""
"Call a callable Python object *callable*, with a variable number of :c:expr:"
"`PyObject *` arguments. The arguments are provided as a variable number of "
@@ -590,13 +571,13 @@ msgstr ""
"呼叫一個可呼叫的 Python 物件 *callable*,附帶數量可變的 :c:expr:`PyObject *` "
"引數。這些引數是以位置在 *NULL* 後面、數量可變的參數來提供。"
-#: ../../c-api/call.rst:326
+#: ../../c-api/call.rst:313
msgid ""
"This is the equivalent of the Python expression: ``callable(arg1, "
"arg2, ...)``."
msgstr "這等價於 Python 運算式 ``callable(arg1, arg2, ...)``。"
-#: ../../c-api/call.rst:332
+#: ../../c-api/call.rst:319
msgid ""
"Call a method of the Python object *obj*, where the name of the method is "
"given as a Python string object in *name*. It is called with a variable "
@@ -607,7 +588,7 @@ msgstr ""
"Python 字串物件給定。被呼叫時會附帶數量可變的 :c:expr:`PyObject *` 引數。這些"
"引數是以位置在 *NULL* 後面、且數量可變的參數來提供。"
-#: ../../c-api/call.rst:343
+#: ../../c-api/call.rst:330
msgid ""
"Call a method of the Python object *obj* without arguments, where the name "
"of the method is given as a Python string object in *name*."
@@ -615,7 +596,7 @@ msgstr ""
"不附帶任何引數地呼叫 Python 物件 *obj* 中的一個 method,其中 method 名稱由 "
"*name* 中的 Python 字串物件給定。"
-#: ../../c-api/call.rst:354
+#: ../../c-api/call.rst:341
msgid ""
"Call a method of the Python object *obj* with a single positional argument "
"*arg*, where the name of the method is given as a Python string object in "
@@ -624,7 +605,7 @@ msgstr ""
"附帶一個位置引數 *arg* 地呼叫 Python 物件 *obj* 中的一個 method,其中 method "
"名稱由 *name* 中的 Python 字串物件給定。"
-#: ../../c-api/call.rst:366
+#: ../../c-api/call.rst:353
msgid ""
"Call a callable Python object *callable*. The arguments are the same as for :"
"c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly "
@@ -634,7 +615,7 @@ msgstr ""
"的相同。如果 *callable* 支援 vectorcall_,則它會直接呼叫存放在 *callable* 中"
"的 vectorcall 函式。"
-#: ../../c-api/call.rst:378
+#: ../../c-api/call.rst:365
msgid ""
"Call *callable* with positional arguments passed exactly as in the "
"vectorcall_ protocol, but with keyword arguments passed as a dictionary "
@@ -643,7 +624,7 @@ msgstr ""
"附帶與在 vectorcall_ 協定中傳入的相同位置引數來呼叫 *callable*,但會加上以字"
"典 *kwdict* 格式傳入的關鍵字引數。*args* 陣列將只包含位置引數。"
-#: ../../c-api/call.rst:382
+#: ../../c-api/call.rst:369
msgid ""
"Regardless of which protocol is used internally, a conversion of arguments "
"needs to be done. Therefore, this function should only be used if the caller "
@@ -653,7 +634,7 @@ msgstr ""
"無論內部使用了哪一種協定,都會需要進行引數的轉換。因此,此函式應該只有在呼叫"
"方已經擁有一個要作為關鍵字引數的字典、但沒有作為位置引數的 tuple 時才被使用。"
-#: ../../c-api/call.rst:392
+#: ../../c-api/call.rst:379
msgid ""
"Call a method using the vectorcall calling convention. The name of the "
"method is given as a Python string *name*. The object whose method is called "
@@ -671,7 +652,7 @@ msgstr ""
"加上 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。關鍵字引數可以像在 :c:func:"
"`PyObject_Vectorcall` 中一樣被傳入。"
-#: ../../c-api/call.rst:401
+#: ../../c-api/call.rst:388
msgid ""
"If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this "
"will call the unbound method object with the full *args* vector as arguments."
@@ -679,14 +660,32 @@ msgstr ""
"如果物件具有 :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 "
"*args* 向量作為引數來呼叫 unbound method(未繫結方法)物件。"
-#: ../../c-api/call.rst:412
+#: ../../c-api/call.rst:399
msgid "Call Support API"
msgstr "呼叫支援 API"
-#: ../../c-api/call.rst:416
+#: ../../c-api/call.rst:403
msgid ""
"Determine if the object *o* is callable. Return ``1`` if the object is "
"callable and ``0`` otherwise. This function always succeeds."
msgstr ""
"判定物件 *o* 是否為可呼叫的。如果物件是可呼叫物件則回傳 ``1``,其他情況回傳 "
"``0``。這個函式不會呼叫失敗。"
+
+#~ msgid ""
+#~ "In CPython 3.8, the vectorcall API and related functions were available "
+#~ "provisionally under names with a leading underscore: "
+#~ "``_PyObject_Vectorcall``, ``_Py_TPFLAGS_HAVE_VECTORCALL``, "
+#~ "``_PyObject_VectorcallMethod``, ``_PyVectorcall_Function``, "
+#~ "``_PyObject_CallOneArg``, ``_PyObject_CallMethodNoArgs``, "
+#~ "``_PyObject_CallMethodOneArg``. Additionally, ``PyObject_VectorcallDict`` "
+#~ "was available as ``_PyObject_FastCallDict``. The old names are still "
+#~ "defined as aliases of the new, non-underscored names."
+#~ msgstr ""
+#~ "在 CPython 3.8 中,vectorcall API 和相關函式暫定以帶開頭底線的名稱提供:"
+#~ "``_PyObject_Vectorcall``、``_Py_TPFLAGS_HAVE_VECTORCALL``、"
+#~ "``_PyObject_VectorcallMethod``、``_PyVectorcall_Function``、"
+#~ "``_PyObject_CallOneArg``、``_PyObject_CallMethodNoArgs``、"
+#~ "``_PyObject_CallMethodOneArg``。此外,``PyObject_VectorcallDict`` 也以 "
+#~ "``_PyObject_FastCallDict`` 名稱提供。這些舊名稱仍有被定義,做為不帶底線的"
+#~ "新名稱的別名。"
diff --git a/c-api/capsule.po b/c-api/capsule.po
index 7ce4bb7a23..42a0ea59ac 100644
--- a/c-api/capsule.po
+++ b/c-api/capsule.po
@@ -5,7 +5,7 @@
# Translators:
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-05-23 14:30+0000\n"
diff --git a/c-api/cell.po b/c-api/cell.po
index 2f91c7b625..1b56cd0661 100644
--- a/c-api/cell.po
+++ b/c-api/cell.po
@@ -9,7 +9,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-10 00:04+0000\n"
"PO-Revision-Date: 2022-10-16 15:33+0800\n"
@@ -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/code.po b/c-api/code.po
index c127f837d6..19d27d2885 100644
--- a/c-api/code.po
+++ b/c-api/code.po
@@ -5,9 +5,9 @@
# Translators:
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-18 00:04+0000\n"
+"POT-Creation-Date: 2024-10-09 00:13+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-"
@@ -48,116 +48,127 @@ msgid ""
msgstr ""
#: ../../c-api/code.rst:35
-msgid "Return the number of free variables in a code object."
+msgid ""
+"Return the number of :term:`free (closure) variables ` in "
+"a code object."
msgstr ""
-#: ../../c-api/code.rst:39
-msgid "Return the position of the first free variable in a code object."
+#: ../../c-api/code.rst:40
+msgid ""
+"Return the position of the first :term:`free (closure) variable ` in a code object."
msgstr ""
-#: ../../c-api/code.rst:43
+#: ../../c-api/code.rst:45
+msgid ""
+"Renamed from ``PyCode_GetFirstFree`` as part of :ref:`unstable-c-api`. The "
+"old name is deprecated, but will remain available until the signature "
+"changes again."
+msgstr ""
+
+#: ../../c-api/code.rst:51
msgid ""
"Return a new code object. If you need a dummy code object to create a "
"frame, use :c:func:`PyCode_NewEmpty` instead."
msgstr ""
-#: ../../c-api/code.rst:46
+#: ../../c-api/code.rst:54
msgid ""
"Since the definition of the bytecode changes often, calling :c:func:"
"`PyUnstable_Code_New` directly can bind you to a precise Python version."
msgstr ""
-#: ../../c-api/code.rst:49
+#: ../../c-api/code.rst:57
msgid ""
"The many arguments of this function are inter-dependent in complex ways, "
"meaning that subtle changes to values are likely to result in incorrect "
"execution or VM crashes. Use this function only with extreme care."
msgstr ""
-#: ../../c-api/code.rst:53
+#: ../../c-api/code.rst:61
msgid "Added ``qualname`` and ``exceptiontable`` parameters."
msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。"
-#: ../../c-api/code.rst:60
+#: ../../c-api/code.rst:68
msgid ""
"Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name "
"is deprecated, but will remain available until the signature changes again."
msgstr ""
-#: ../../c-api/code.rst:66
+#: ../../c-api/code.rst:74
msgid ""
"Similar to :c:func:`PyUnstable_Code_New`, but with an extra "
"\"posonlyargcount\" for positional-only arguments. The same caveats that "
"apply to ``PyUnstable_Code_New`` also apply to this function."
msgstr ""
-#: ../../c-api/code.rst:71
+#: ../../c-api/code.rst:79
msgid "as ``PyCode_NewWithPosOnlyArgs``"
msgstr ""
-#: ../../c-api/code.rst:73
+#: ../../c-api/code.rst:81
msgid "Added ``qualname`` and ``exceptiontable`` parameters."
msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。"
-#: ../../c-api/code.rst:78
+#: ../../c-api/code.rst:86
msgid ""
"Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is "
"deprecated, but will remain available until the signature changes again."
msgstr ""
-#: ../../c-api/code.rst:84
+#: ../../c-api/code.rst:92
msgid ""
"Return a new empty code object with the specified filename, function name, "
"and first line number. The resulting code object will raise an ``Exception`` "
"if executed."
msgstr ""
-#: ../../c-api/code.rst:90
+#: ../../c-api/code.rst:98
msgid ""
"Return the line number of the instruction that occurs on or before "
"``byte_offset`` and ends after it. If you just need the line number of a "
"frame, use :c:func:`PyFrame_GetLineNumber` instead."
msgstr ""
-#: ../../c-api/code.rst:93
+#: ../../c-api/code.rst:101
msgid ""
"For efficiently iterating over the line numbers in a code object, use :pep:"
"`the API described in PEP 626 <0626#out-of-process-debuggers-and-profilers>`."
msgstr ""
-#: ../../c-api/code.rst:98
+#: ../../c-api/code.rst:106
msgid ""
"Sets the passed ``int`` pointers to the source code line and column numbers "
"for the instruction at ``byte_offset``. Sets the value to ``0`` when "
"information is not available for any particular element."
msgstr ""
-#: ../../c-api/code.rst:102
+#: ../../c-api/code.rst:110
msgid "Returns ``1`` if the function succeeds and 0 otherwise."
msgstr ""
-#: ../../c-api/code.rst:108
+#: ../../c-api/code.rst:116
msgid ""
"Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong "
"reference to a :c:type:`PyBytesObject` representing the bytecode in a code "
"object. On error, ``NULL`` is returned and an exception is raised."
msgstr ""
-#: ../../c-api/code.rst:113
+#: ../../c-api/code.rst:121
msgid ""
"This ``PyBytesObject`` may be created on-demand by the interpreter and does "
"not necessarily represent the bytecode actually executed by CPython. The "
"primary use case for this function is debuggers and profilers."
msgstr ""
-#: ../../c-api/code.rst:121
+#: ../../c-api/code.rst:129
msgid ""
"Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new "
"reference to a :c:type:`PyTupleObject` containing the names of the local "
"variables. On error, ``NULL`` is returned and an exception is raised."
msgstr ""
-#: ../../c-api/code.rst:130
+#: ../../c-api/code.rst:138
msgid ""
"Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new "
"reference to a :c:type:`PyTupleObject` containing the names of the local "
@@ -165,14 +176,15 @@ msgid ""
"returned and an exception is raised."
msgstr ""
-#: ../../c-api/code.rst:139
+#: ../../c-api/code.rst:147
msgid ""
"Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new "
-"reference to a :c:type:`PyTupleObject` containing the names of the free "
-"variables. On error, ``NULL`` is returned and an exception is raised."
+"reference to a :c:type:`PyTupleObject` containing the names of the :term:"
+"`free (closure) variables `. On error, ``NULL`` is "
+"returned and an exception is raised."
msgstr ""
-#: ../../c-api/code.rst:147
+#: ../../c-api/code.rst:156
msgid ""
"Register *callback* as a code object watcher for the current interpreter. "
"Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case "
@@ -180,7 +192,7 @@ msgid ""
"exception."
msgstr ""
-#: ../../c-api/code.rst:156
+#: ../../c-api/code.rst:165
msgid ""
"Clear watcher identified by *watcher_id* previously returned from :c:func:"
"`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or "
@@ -188,17 +200,17 @@ msgid ""
"never registered.)"
msgstr ""
-#: ../../c-api/code.rst:165
+#: ../../c-api/code.rst:174
msgid ""
"Enumeration of possible code object watcher events: - "
"``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``"
msgstr ""
-#: ../../c-api/code.rst:173
+#: ../../c-api/code.rst:182
msgid "Type of a code object watcher callback function."
msgstr ""
-#: ../../c-api/code.rst:175
+#: ../../c-api/code.rst:184
msgid ""
"If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after "
"`co` has been fully initialized. Otherwise, the callback is invoked before "
@@ -206,7 +218,7 @@ msgid ""
"inspected."
msgstr ""
-#: ../../c-api/code.rst:180
+#: ../../c-api/code.rst:189
msgid ""
"If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback "
"to the about-to-be-destroyed code object will resurrect it and prevent it "
@@ -214,7 +226,7 @@ msgid ""
"later, any watcher callbacks active at that time will be called again."
msgstr ""
-#: ../../c-api/code.rst:185
+#: ../../c-api/code.rst:194
msgid ""
"Users of this API should not rely on internal runtime implementation "
"details. Such details may include, but are not limited to, the exact order "
@@ -224,14 +236,14 @@ msgid ""
"the Python code being executed."
msgstr ""
-#: ../../c-api/code.rst:192
+#: ../../c-api/code.rst:201
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``."
msgstr ""
-#: ../../c-api/code.rst:196
+#: ../../c-api/code.rst:205
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 "
@@ -240,85 +252,85 @@ msgid ""
"it before returning."
msgstr ""
-#: ../../c-api/code.rst:206
+#: ../../c-api/code.rst:215
msgid "Extra information"
msgstr ""
-#: ../../c-api/code.rst:208
+#: ../../c-api/code.rst:217
msgid ""
"To support low-level extensions to frame evaluation, such as external just-"
"in-time compilers, it is possible to attach arbitrary extra data to code "
"objects."
msgstr ""
-#: ../../c-api/code.rst:212
+#: ../../c-api/code.rst:221
msgid ""
"These functions are part of the unstable C API tier: this functionality is a "
"CPython implementation detail, and the API may change without deprecation "
"warnings."
msgstr ""
-#: ../../c-api/code.rst:218
+#: ../../c-api/code.rst:227
msgid "Return a new an opaque index value used to adding data to code objects."
msgstr ""
-#: ../../c-api/code.rst:220
+#: ../../c-api/code.rst:229
msgid ""
"You generally call this function once (per interpreter) and use the result "
"with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on "
"individual code objects."
msgstr ""
-#: ../../c-api/code.rst:224
+#: ../../c-api/code.rst:233
msgid ""
"If *free* is not ``NULL``: when a code object is deallocated, *free* will be "
"called on non-``NULL`` data stored under the new index. Use :c:func:"
"`Py_DecRef` when storing :c:type:`PyObject`."
msgstr ""
-#: ../../c-api/code.rst:230
+#: ../../c-api/code.rst:239
msgid "as ``_PyEval_RequestCodeExtraIndex``"
msgstr ""
-#: ../../c-api/code.rst:234
+#: ../../c-api/code.rst:243
msgid ""
"Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name "
"is deprecated, but will be available until the API changes."
msgstr ""
-#: ../../c-api/code.rst:240
+#: ../../c-api/code.rst:249
msgid ""
"Set *extra* to the extra data stored under the given index. Return 0 on "
"success. Set an exception and return -1 on failure."
msgstr ""
-#: ../../c-api/code.rst:243
+#: ../../c-api/code.rst:252
msgid ""
"If no data was set under the index, set *extra* to ``NULL`` and return 0 "
"without setting an exception."
msgstr ""
-#: ../../c-api/code.rst:248
+#: ../../c-api/code.rst:257
msgid "as ``_PyCode_GetExtra``"
msgstr ""
-#: ../../c-api/code.rst:252
+#: ../../c-api/code.rst:261
msgid ""
"Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, "
"but will be available until the API changes."
msgstr ""
-#: ../../c-api/code.rst:258
+#: ../../c-api/code.rst:267
msgid ""
"Set the extra data stored under the given index to *extra*. Return 0 on "
"success. Set an exception and return -1 on failure."
msgstr ""
-#: ../../c-api/code.rst:263
+#: ../../c-api/code.rst:272
msgid "as ``_PyCode_SetExtra``"
msgstr ""
-#: ../../c-api/code.rst:267
+#: ../../c-api/code.rst:276
msgid ""
"Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, "
"but will be available until the API changes."
@@ -336,22 +348,22 @@ msgstr "code(程式碼)"
msgid "code object"
msgstr "code object(程式碼物件)"
-#: ../../c-api/code.rst:56
+#: ../../c-api/code.rst:64
msgid "PyCode_New (C function)"
msgstr "PyCode_New(C 函式)"
-#: ../../c-api/code.rst:69
+#: ../../c-api/code.rst:77
msgid "PyCode_NewWithPosOnlyArgs (C function)"
msgstr "PyCode_NewWithPosOnlyArgs(C 函式)"
-#: ../../c-api/code.rst:228
+#: ../../c-api/code.rst:237
msgid "_PyEval_RequestCodeExtraIndex (C function)"
msgstr "_PyEval_RequestCodeExtraIndex(C 函式)"
-#: ../../c-api/code.rst:246
+#: ../../c-api/code.rst:255
msgid "_PyCode_GetExtra (C function)"
msgstr "_PyCode_GetExtra(C 函式)"
-#: ../../c-api/code.rst:261
+#: ../../c-api/code.rst:270
msgid "_PyCode_SetExtra (C function)"
msgstr "_PyCode_SetExtra(C 函式)"
diff --git a/c-api/codec.po b/c-api/codec.po
index 68de1f7702..6fd7c61a7f 100644
--- a/c-api/codec.po
+++ b/c-api/codec.po
@@ -5,7 +5,7 @@
# Matt Wang , 2023
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
"PO-Revision-Date: 2023-07-24 17:51+0000\n"
@@ -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 8d905e1455..a22103f9b4 100644
--- a/c-api/complex.po
+++ b/c-api/complex.po
@@ -5,9 +5,9 @@
# Matt Wang , 2023
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -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。這個函式不會失敗。"
@@ -182,43 +182,71 @@ msgstr "以 C 的 :c:expr:`double` 形式回傳 *op* 的實部。"
#: ../../c-api/complex.rst:126
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."
+msgstr ""
+"如果 *op* 不是 Python 複數物件,但有一個 :meth:`~object.__complex__` 方法,則"
+"首先會呼叫該方法將 *op* 轉換為 Python 複數物件。如果 :meth:`!__complex__` 並"
+"未定義,那麼它會回退到呼叫 :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."
+msgstr "如果可用則使用 :meth:`~object.__complex__`。"
-#: ../../c-api/complex.rst:132
+#: ../../c-api/complex.rst:140
msgid "Return the imaginary part of *op* as a C :c:expr:`double`."
msgstr "將 *op* 的虛部作為 C 的 :c:expr:`double` 回傳。"
-#: ../../c-api/complex.rst:137
+#: ../../c-api/complex.rst:142
+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."
+msgstr ""
+"如果 *op* 不是 Python 複數物件,但有一個 :meth:`~object.__complex__` 方法,則"
+"首先會呼叫該方法將 *op* 轉換為 Python 複數物件。如果 :meth:`!__complex__` 並"
+"未定義,那麼它會回退到呼叫 :func:`PyFloat_AsDouble` 並於成功時回傳 ``0.0``。"
+
+#: ../../c-api/complex.rst:156
msgid "Return the :c:type:`Py_complex` value of the complex number *op*."
msgstr "回傳複數 *op* 的 :c:type:`Py_complex` 值。"
-#: ../../c-api/complex.rst:139
+#: ../../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__` 並"
"未定義,那麼它會回退到 :meth:`~object.__float__`。如果 :meth:`!__float__` 未"
"定義,則它將繼續回退為 :meth:`~object.__index__`。"
-#: ../../c-api/complex.rst:145
+#: ../../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` 來檢查錯誤。"
-#: ../../c-api/complex.rst:149
+#: ../../c-api/complex.rst:168
msgid "Use :meth:`~object.__index__` if available."
msgstr "如果可用則使用 :meth:`~object.__index__`。"
diff --git a/c-api/concrete.po b/c-api/concrete.po
index 4db03592ba..cafd42eadc 100644
--- a/c-api/concrete.po
+++ b/c-api/concrete.po
@@ -6,7 +6,7 @@
# Matt Wang , 2022
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-05-09 00:15+0000\n"
"PO-Revision-Date: 2022-11-13 20:37+0800\n"
diff --git a/c-api/contextvars.po b/c-api/contextvars.po
index 1f5674b054..8e7184e42d 100644
--- a/c-api/contextvars.po
+++ b/c-api/contextvars.po
@@ -3,7 +3,7 @@
# This file is distributed under the same license as the Python package.
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2018-07-15 18:56+0800\n"
diff --git a/c-api/conversion.po b/c-api/conversion.po
index d7c2b52620..a8c2e00699 100644
--- a/c-api/conversion.po
+++ b/c-api/conversion.po
@@ -7,7 +7,7 @@
# Matt Wang , 2023
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-27 00:03+0000\n"
"PO-Revision-Date: 2023-12-11 18:26+0000\n"
diff --git a/c-api/coro.po b/c-api/coro.po
index 5d375aa714..1a5f027a6d 100644
--- a/c-api/coro.po
+++ b/c-api/coro.po
@@ -8,7 +8,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-13 00:11+0000\n"
"PO-Revision-Date: 2021-12-09 21:15+0800\n"
diff --git a/c-api/datetime.po b/c-api/datetime.po
index e2e8158f5d..60f4918fdc 100644
--- a/c-api/datetime.po
+++ b/c-api/datetime.po
@@ -8,7 +8,7 @@
# Matt Wang , 2023
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-22 00:03+0000\n"
"PO-Revision-Date: 2023-07-01 04:14+0800\n"
@@ -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/descriptor.po b/c-api/descriptor.po
index 4a8d94a8d2..314623827e 100644
--- a/c-api/descriptor.po
+++ b/c-api/descriptor.po
@@ -8,7 +8,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-26 16:47+0000\n"
"PO-Revision-Date: 2021-12-09 20:56+0800\n"
diff --git a/c-api/dict.po b/c-api/dict.po
index e696336c09..b11b75f775 100644
--- a/c-api/dict.po
+++ b/c-api/dict.po
@@ -7,9 +7,9 @@
# Liang-Bo Wang , 2015
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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-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 ""
@@ -66,7 +66,7 @@ msgstr ""
#: ../../c-api/dict.rst:48
msgid "Empty an existing dictionary of all key-value pairs."
-msgstr ""
+msgstr "清空現有字典中的所有鍵值對。"
#: ../../c-api/dict.rst:53
msgid ""
@@ -76,81 +76,121 @@ msgid ""
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*`."
+msgstr ""
+
+#: ../../c-api/dict.rst:69
msgid "Return a new dictionary that contains the same key-value pairs as *p*."
msgstr ""
-#: ../../c-api/dict.rst:65
+#: ../../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:73
+#: ../../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:80
+#: ../../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:88
+#: ../../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:95
+#: ../../c-api/dict.rst:104
msgid ""
-"Return the object from dictionary *p* which has a key *key*. Return "
-"``NULL`` if the key *key* is not present, but *without* setting an exception."
+"Return a new :term:`strong reference` to the object from dictionary *p* "
+"which has a key *key*:"
msgstr ""
-#: ../../c-api/dict.rst:100
+#: ../../c-api/dict.rst:107
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."
+"If the key is present, set *\\*result* to a new :term:`strong reference` to "
+"the value and return ``1``."
msgstr ""
-#: ../../c-api/dict.rst:104
+#: ../../c-api/dict.rst:109
+msgid "If the key is missing, set *\\*result* to ``NULL`` and return ``0``."
+msgstr ""
+
+#: ../../c-api/dict.rst:110 ../../c-api/dict.rst:207
+msgid "On error, raise an exception and return ``-1``."
+msgstr "錯誤發生時,引發一個例外並回傳 ``-1``。"
+
+#: ../../c-api/dict.rst:114
+msgid "See also the :c:func:`PyObject_GetItem` function."
+msgstr "另見 :c:func:`PyObject_GetItem` 函式。"
+
+#: ../../c-api/dict.rst:119
+msgid ""
+"Return a :term:`borrowed reference` to the object from dictionary *p* which "
+"has a key *key*. Return ``NULL`` if the key *key* is missing *without* "
+"setting an exception."
+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."
+msgstr ""
+
+#: ../../c-api/dict.rst:129
msgid ""
"Calling this API without :term:`GIL` held had been allowed for historical "
"reason. It is no longer allowed."
msgstr ""
-#: ../../c-api/dict.rst:111
+#: ../../c-api/dict.rst:136
msgid ""
"Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. "
"Return ``NULL`` **with** an exception set if an exception occurred. Return "
"``NULL`` **without** an exception set if the key wasn't present."
msgstr ""
-#: ../../c-api/dict.rst:119
+#: ../../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:125
+#: ../../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:134
+#: ../../c-api/dict.rst:159
+msgid ""
+"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
msgid ""
"This is the same as the Python-level :meth:`dict.setdefault`. If present, "
"it returns the value corresponding to *key* from the dictionary *p*. If the "
@@ -160,47 +200,97 @@ msgid ""
"the insertion."
msgstr ""
-#: ../../c-api/dict.rst:144
+#: ../../c-api/dict.rst:179
msgid ""
-"Return a :c:type:`PyListObject` containing all the items from the dictionary."
+"Inserts *default_value* into the dictionary *p* with a key of *key* if the "
+"key is not already present in the dictionary. If *result* is not ``NULL``, "
+"then *\\*result* is set to a :term:`strong reference` to either "
+"*default_value*, if the key was not present, or the existing value, if *key* "
+"was already present in the dictionary. Returns ``1`` if the key was present "
+"and *default_value* was not inserted, or ``0`` if the key was not present "
+"and *default_value* was inserted. On failure, returns ``-1``, sets an "
+"exception, and sets ``*result`` to ``NULL``."
msgstr ""
-#: ../../c-api/dict.rst:149
+#: ../../c-api/dict.rst:189
msgid ""
-"Return a :c:type:`PyListObject` containing all the keys from the dictionary."
+"For clarity: if you have a strong reference to *default_value* before "
+"calling this function, then after it returns, you hold a strong reference to "
+"both *default_value* and *\\*result* (if it's not ``NULL``). These may refer "
+"to the same object: in that case you hold two separate references to it."
+msgstr ""
+
+#: ../../c-api/dict.rst:200
+msgid ""
+"Remove *key* from dictionary *p* and optionally return the removed value. Do "
+"not raise :exc:`KeyError` if the key missing."
+msgstr ""
+
+#: ../../c-api/dict.rst:203
+msgid ""
+"If the key is present, set *\\*result* to a new reference to the removed "
+"value if *result* is not ``NULL``, and return ``1``."
+msgstr ""
+
+#: ../../c-api/dict.rst:205
+msgid ""
+"If the key is missing, set *\\*result* to ``NULL`` if *result* is not "
+"``NULL``, and return ``0``."
msgstr ""
-#: ../../c-api/dict.rst:154
+#: ../../c-api/dict.rst:209
+msgid ""
+"Similar to :meth:`dict.pop`, but without the default value and not "
+"raising :exc:`KeyError` if the key missing."
+msgstr ""
+
+#: ../../c-api/dict.rst:217
+msgid ""
+"Similar to :c:func:`PyDict_Pop`, 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:226
+msgid ""
+"Return a :c:type:`PyListObject` containing all the items from the dictionary."
+msgstr "回傳一個包含字典中所有項目的 :c:type:`PyListObject`。"
+
+#: ../../c-api/dict.rst:231
+msgid ""
+"Return a :c:type:`PyListObject` containing all the keys from the dictionary."
+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:162
+#: ../../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:168
+#: ../../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:179
+#: ../../c-api/dict.rst:261
msgid "For example::"
msgstr "舉例來說: ::"
-#: ../../c-api/dict.rst:181
+#: ../../c-api/dict.rst:263
msgid ""
"PyObject *key, *value;\n"
"Py_ssize_t pos = 0;\n"
@@ -211,14 +301,14 @@ msgid ""
"}"
msgstr ""
-#: ../../c-api/dict.rst:189
+#: ../../c-api/dict.rst:271
msgid ""
"The dictionary *p* should not be mutated during iteration. It is safe to "
"modify the values of the keys as you iterate over the dictionary, but only "
"so long as the set of keys does not change. For example::"
msgstr ""
-#: ../../c-api/dict.rst:193
+#: ../../c-api/dict.rst:275
msgid ""
"PyObject *key, *value;\n"
"Py_ssize_t pos = 0;\n"
@@ -256,7 +346,29 @@ msgstr ""
" Py_DECREF(o);\n"
"}"
-#: ../../c-api/dict.rst:214
+#: ../../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::"
+msgstr ""
+
+#: ../../c-api/dict.rst:298
+msgid ""
+"Py_BEGIN_CRITICAL_SECTION(self->dict);\n"
+"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n"
+" ...\n"
+"}\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 ""
"Iterate over mapping object *b* adding key-value pairs to dictionary *a*. "
"*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` "
@@ -266,16 +378,16 @@ msgid ""
"or ``-1`` if an exception was raised."
msgstr ""
-#: ../../c-api/dict.rst:224
+#: ../../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 ""
-#: ../../c-api/dict.rst:233
+#: ../../c-api/dict.rst:326
msgid ""
"Update or merge into dictionary *a*, from the key-value pairs in *seq2*. "
"*seq2* must be an iterable object producing iterable objects of length 2, "
@@ -284,7 +396,7 @@ msgid ""
"if an exception was raised. Equivalent Python (except for the return value)::"
msgstr ""
-#: ../../c-api/dict.rst:240
+#: ../../c-api/dict.rst:333
msgid ""
"def PyDict_MergeFromSeq2(a, seq2, override):\n"
" for key, value in seq2:\n"
@@ -296,7 +408,7 @@ msgstr ""
" if override or key not in a:\n"
" a[key] = value"
-#: ../../c-api/dict.rst:247
+#: ../../c-api/dict.rst:340
msgid ""
"Register *callback* as a dictionary watcher. Return a non-negative integer "
"id which must be passed to future calls to :c:func:`PyDict_Watch`. In case "
@@ -304,21 +416,21 @@ msgid ""
"exception."
msgstr ""
-#: ../../c-api/dict.rst:256
+#: ../../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:264
+#: ../../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 ""
-#: ../../c-api/dict.rst:272
+#: ../../c-api/dict.rst:365
msgid ""
"Mark dictionary *dict* as no longer watched. The callback granted "
"*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when "
@@ -326,7 +438,7 @@ msgid ""
"watched by this watcher. Return ``0`` on success or ``-1`` on error."
msgstr ""
-#: ../../c-api/dict.rst:281
+#: ../../c-api/dict.rst:374
msgid ""
"Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, "
"``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, "
@@ -334,11 +446,11 @@ msgid ""
"``PyDict_EVENT_DEALLOCATED``."
msgstr ""
-#: ../../c-api/dict.rst:289
+#: ../../c-api/dict.rst:382
msgid "Type of a dict watcher callback function."
msgstr ""
-#: ../../c-api/dict.rst:291
+#: ../../c-api/dict.rst:384
msgid ""
"If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both "
"*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED`` "
@@ -347,7 +459,7 @@ msgid ""
"dictionary and *new_value* will be ``NULL``."
msgstr ""
-#: ../../c-api/dict.rst:297
+#: ../../c-api/dict.rst:390
msgid ""
"``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another "
"dict is merged into it. To maintain efficiency of this operation, per-key "
@@ -355,14 +467,14 @@ msgid ""
"``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary."
msgstr ""
-#: ../../c-api/dict.rst:303
+#: ../../c-api/dict.rst:396
msgid ""
"The callback may inspect but must not modify *dict*; doing so could have "
"unpredictable effects, including infinite recursion. Do not trigger Python "
"code execution in the callback, as it could modify the dict as a side effect."
msgstr ""
-#: ../../c-api/dict.rst:307
+#: ../../c-api/dict.rst:400
msgid ""
"If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the "
"callback to the about-to-be-destroyed dictionary will resurrect it and "
@@ -371,20 +483,20 @@ msgid ""
"again."
msgstr ""
-#: ../../c-api/dict.rst:313
+#: ../../c-api/dict.rst:406
msgid ""
"Callbacks occur before the notified modification to *dict* takes place, so "
"the prior state of *dict* can be inspected."
msgstr ""
-#: ../../c-api/dict.rst:316
+#: ../../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:320
+#: ../../c-api/dict.rst:413
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 "
@@ -401,11 +513,11 @@ msgstr "object(物件)"
msgid "dictionary"
msgstr "dictionary(字典)"
-#: ../../c-api/dict.rst:160
+#: ../../c-api/dict.rst:242
msgid "built-in function"
msgstr "built-in function(內建函式)"
-#: ../../c-api/dict.rst:160
+#: ../../c-api/dict.rst:242
msgid "len"
msgstr "len"
diff --git a/c-api/exceptions.po b/c-api/exceptions.po
index 9c9a07f5a1..a2e93cc598 100644
--- a/c-api/exceptions.po
+++ b/c-api/exceptions.po
@@ -6,9 +6,9 @@
# Ching-Lung Chuang, 2015
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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: 2024-10-11 00:13+0000\n"
"PO-Revision-Date: 2018-05-23 14:05+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -143,22 +143,31 @@ msgstr "使用 :func:`sys.unraisablehook`。"
#: ../../c-api/exceptions.rst:104
msgid ""
+"Similar to :c:func:`PyErr_WriteUnraisable`, but the *format* and subsequent "
+"parameters help format the warning message; they have the same meaning and "
+"values as in :c:func:`PyUnicode_FromFormat`. ``PyErr_WriteUnraisable(obj)`` "
+"is roughly equivalent to ``PyErr_FormatUnraisable(\"Exception ignored in: "
+"%R\", obj)``. If *format* is ``NULL``, only the traceback is printed."
+msgstr ""
+
+#: ../../c-api/exceptions.rst:116
+msgid ""
"Print the standard traceback display of ``exc`` to ``sys.stderr``, including "
"chained exceptions and notes."
msgstr ""
-#: ../../c-api/exceptions.rst:110
+#: ../../c-api/exceptions.rst:123
msgid "Raising exceptions"
msgstr ""
-#: ../../c-api/exceptions.rst:112
+#: ../../c-api/exceptions.rst:125
msgid ""
"These functions help you set the current thread's error indicator. For "
"convenience, some of these functions will always return a ``NULL`` pointer "
"for use in a ``return`` statement."
msgstr ""
-#: ../../c-api/exceptions.rst:119
+#: ../../c-api/exceptions.rst:132
msgid ""
"This is the most common way to set the error indicator. The first argument "
"specifies the exception type; it is normally one of the standard exceptions, "
@@ -167,13 +176,13 @@ msgid ""
"error message; it is decoded from ``'utf-8'``."
msgstr ""
-#: ../../c-api/exceptions.rst:128
+#: ../../c-api/exceptions.rst:141
msgid ""
"This function is similar to :c:func:`PyErr_SetString` but lets you specify "
"an arbitrary Python object for the \"value\" of the exception."
msgstr ""
-#: ../../c-api/exceptions.rst:134
+#: ../../c-api/exceptions.rst:147
msgid ""
"This function sets the error indicator and returns ``NULL``. *exception* "
"should be a Python exception class. The *format* and subsequent parameters "
@@ -181,31 +190,31 @@ msgid ""
"c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string."
msgstr ""
-#: ../../c-api/exceptions.rst:143
+#: ../../c-api/exceptions.rst:156
msgid ""
"Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument "
"rather than a variable number of arguments."
msgstr ""
-#: ../../c-api/exceptions.rst:151
+#: ../../c-api/exceptions.rst:164
msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``."
msgstr ""
-#: ../../c-api/exceptions.rst:156
+#: ../../c-api/exceptions.rst:169
msgid ""
"This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where "
"*message* indicates that a built-in operation was invoked with an illegal "
"argument. It is mostly for internal use."
msgstr ""
-#: ../../c-api/exceptions.rst:163
+#: ../../c-api/exceptions.rst:176
msgid ""
"This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns "
"``NULL`` so an object allocation function can write ``return "
"PyErr_NoMemory();`` when it runs out of memory."
msgstr ""
-#: ../../c-api/exceptions.rst:172
+#: ../../c-api/exceptions.rst:185
msgid ""
"This is a convenience function to raise an exception when a C library "
"function has returned an error and set the C variable :c:data:`errno`. It "
@@ -219,7 +228,7 @@ msgid ""
"``return PyErr_SetFromErrno(type);`` when the system call returns an error."
msgstr ""
-#: ../../c-api/exceptions.rst:186
+#: ../../c-api/exceptions.rst:199
msgid ""
"Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that "
"if *filenameObject* is not ``NULL``, it is passed to the constructor of "
@@ -227,21 +236,21 @@ msgid ""
"is used to define the :attr:`!filename` attribute of the exception instance."
msgstr ""
-#: ../../c-api/exceptions.rst:195
+#: ../../c-api/exceptions.rst:208
msgid ""
"Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a "
"second filename object, for raising errors when a function that takes two "
"filenames fails."
msgstr ""
-#: ../../c-api/exceptions.rst:204
+#: ../../c-api/exceptions.rst:217
msgid ""
"Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename "
"is given as a C string. *filename* is decoded from the :term:`filesystem "
"encoding and error handler`."
msgstr ""
-#: ../../c-api/exceptions.rst:211
+#: ../../c-api/exceptions.rst:224
msgid ""
"This is a convenience function to raise :exc:`OSError`. If called with "
"*ierr* of ``0``, the error code returned by a call to :c:func:`!"
@@ -255,19 +264,19 @@ msgid ""
"``NULL``."
msgstr ""
-#: ../../c-api/exceptions.rst:221 ../../c-api/exceptions.rst:229
-#: ../../c-api/exceptions.rst:240 ../../c-api/exceptions.rst:250
-#: ../../c-api/exceptions.rst:258 ../../c-api/exceptions.rst:268
-msgid ":ref:`Availability `: Windows."
-msgstr ":ref:`適用 `:Windows。"
+#: ../../c-api/exceptions.rst:234 ../../c-api/exceptions.rst:242
+#: ../../c-api/exceptions.rst:253 ../../c-api/exceptions.rst:263
+#: ../../c-api/exceptions.rst:271 ../../c-api/exceptions.rst:281
+msgid "Availability"
+msgstr ""
-#: ../../c-api/exceptions.rst:226
+#: ../../c-api/exceptions.rst:239
msgid ""
"Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter "
"specifying the exception type to be raised."
msgstr ""
-#: ../../c-api/exceptions.rst:234
+#: ../../c-api/exceptions.rst:247
msgid ""
"Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior "
"that if *filename* is not ``NULL``, it is decoded from the filesystem "
@@ -276,7 +285,7 @@ msgid ""
"attribute of the exception instance."
msgstr ""
-#: ../../c-api/exceptions.rst:245
+#: ../../c-api/exceptions.rst:258
msgid ""
"Similar to :c:func:`PyErr_SetExcFromWindowsErr`, with the additional "
"behavior that if *filename* is not ``NULL``, it is passed to the constructor "
@@ -284,19 +293,19 @@ msgid ""
"filename` attribute of the exception instance."
msgstr ""
-#: ../../c-api/exceptions.rst:255
+#: ../../c-api/exceptions.rst:268
msgid ""
"Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but "
"accepts a second filename object."
msgstr ""
-#: ../../c-api/exceptions.rst:265
+#: ../../c-api/exceptions.rst:278
msgid ""
"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional "
"parameter specifying the exception type to be raised."
msgstr ""
-#: ../../c-api/exceptions.rst:273
+#: ../../c-api/exceptions.rst:286
msgid ""
"This is a convenience function to raise :exc:`ImportError`. *msg* will be "
"set as the exception's message string. *name* and *path*, both of which can "
@@ -304,13 +313,13 @@ msgid ""
"``path`` attributes."
msgstr ""
-#: ../../c-api/exceptions.rst:283
+#: ../../c-api/exceptions.rst:296
msgid ""
"Much like :c:func:`PyErr_SetImportError` but this function allows for "
"specifying a subclass of :exc:`ImportError` to raise."
msgstr ""
-#: ../../c-api/exceptions.rst:291
+#: ../../c-api/exceptions.rst:304
msgid ""
"Set file, line, and offset information for the current exception. If the "
"current exception is not a :exc:`SyntaxError`, then it sets additional "
@@ -318,19 +327,19 @@ msgid ""
"is a :exc:`SyntaxError`."
msgstr ""
-#: ../../c-api/exceptions.rst:301
+#: ../../c-api/exceptions.rst:314
msgid ""
"Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string "
"decoded from the :term:`filesystem encoding and error handler`."
msgstr ""
-#: ../../c-api/exceptions.rst:309
+#: ../../c-api/exceptions.rst:322
msgid ""
"Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is "
"omitted."
msgstr ""
-#: ../../c-api/exceptions.rst:315
+#: ../../c-api/exceptions.rst:328
msgid ""
"This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, "
"where *message* indicates that an internal operation (e.g. a Python/C API "
@@ -338,11 +347,11 @@ msgid ""
"use."
msgstr ""
-#: ../../c-api/exceptions.rst:322
+#: ../../c-api/exceptions.rst:335
msgid "Issuing warnings"
msgstr ""
-#: ../../c-api/exceptions.rst:324
+#: ../../c-api/exceptions.rst:337
msgid ""
"Use these functions to issue warnings from C code. They mirror similar "
"functions exported by the Python :mod:`warnings` module. They normally "
@@ -358,7 +367,7 @@ msgid ""
"return an error value)."
msgstr ""
-#: ../../c-api/exceptions.rst:339
+#: ../../c-api/exceptions.rst:352
msgid ""
"Issue a warning message. The *category* argument is a warning category (see "
"below) or ``NULL``; the *message* argument is a UTF-8 encoded string. "
@@ -368,7 +377,7 @@ msgid ""
"`PyErr_WarnEx`, 2 is the function above that, and so forth."
msgstr ""
-#: ../../c-api/exceptions.rst:346
+#: ../../c-api/exceptions.rst:359
msgid ""
"Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:"
"`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default "
@@ -377,14 +386,14 @@ msgid ""
"enumerated at :ref:`standardwarningcategories`."
msgstr ""
-#: ../../c-api/exceptions.rst:352
+#: ../../c-api/exceptions.rst:365
msgid ""
"For information about warning control, see the documentation for the :mod:"
"`warnings` module and the :option:`-W` option in the command line "
"documentation. There is no C API for warning control."
msgstr ""
-#: ../../c-api/exceptions.rst:359
+#: ../../c-api/exceptions.rst:372
msgid ""
"Issue a warning message with explicit control over all warning attributes. "
"This is a straightforward wrapper around the Python function :func:`warnings."
@@ -392,32 +401,32 @@ msgid ""
"arguments may be set to ``NULL`` to get the default effect described there."
msgstr ""
-#: ../../c-api/exceptions.rst:370
+#: ../../c-api/exceptions.rst:383
msgid ""
"Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and "
"*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:"
"`filesystem encoding and error handler`."
msgstr ""
-#: ../../c-api/exceptions.rst:377
+#: ../../c-api/exceptions.rst:390
msgid ""
"Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:"
"`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-"
"encoded string."
msgstr ""
-#: ../../c-api/exceptions.rst:386
+#: ../../c-api/exceptions.rst:399
msgid ""
"Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:"
"`ResourceWarning` and it passes *source* to :class:`!warnings."
"WarningMessage`."
msgstr ""
-#: ../../c-api/exceptions.rst:393
+#: ../../c-api/exceptions.rst:406
msgid "Querying the error indicator"
msgstr ""
-#: ../../c-api/exceptions.rst:397
+#: ../../c-api/exceptions.rst:410
msgid ""
"Test whether the error indicator is set. If set, return the exception "
"*type* (the first argument to the last call to one of the ``PyErr_Set*`` "
@@ -426,11 +435,11 @@ msgid ""
"`Py_DECREF` it."
msgstr ""
-#: ../../c-api/exceptions.rst:403
+#: ../../c-api/exceptions.rst:416
msgid "The caller must hold the GIL."
msgstr ""
-#: ../../c-api/exceptions.rst:407
+#: ../../c-api/exceptions.rst:420
msgid ""
"Do not compare the return value to a specific exception; use :c:func:"
"`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily "
@@ -438,14 +447,14 @@ msgid ""
"of a class exception, or it may be a subclass of the expected exception.)"
msgstr ""
-#: ../../c-api/exceptions.rst:415
+#: ../../c-api/exceptions.rst:428
msgid ""
"Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This "
"should only be called when an exception is actually set; a memory access "
"violation will occur if no exception has been raised."
msgstr ""
-#: ../../c-api/exceptions.rst:422
+#: ../../c-api/exceptions.rst:435
msgid ""
"Return true if the *given* exception matches the exception type in *exc*. "
"If *exc* is a class object, this also returns true when *given* is an "
@@ -453,23 +462,23 @@ msgid ""
"tuple (and recursively in subtuples) are searched for a match."
msgstr ""
-#: ../../c-api/exceptions.rst:430
+#: ../../c-api/exceptions.rst:443
msgid ""
"Return the exception currently being raised, clearing the error indicator at "
"the same time. Return ``NULL`` if the error indicator is not set."
msgstr ""
-#: ../../c-api/exceptions.rst:433
+#: ../../c-api/exceptions.rst:446
msgid ""
"This function is used by code that needs to catch exceptions, or code that "
"needs to save and restore the error indicator temporarily."
msgstr ""
-#: ../../c-api/exceptions.rst:436 ../../c-api/exceptions.rst:480
+#: ../../c-api/exceptions.rst:449 ../../c-api/exceptions.rst:493
msgid "For example::"
msgstr "舉例來說: ::"
-#: ../../c-api/exceptions.rst:438
+#: ../../c-api/exceptions.rst:451
msgid ""
"{\n"
" PyObject *exc = PyErr_GetRaisedException();\n"
@@ -480,27 +489,27 @@ msgid ""
"}"
msgstr ""
-#: ../../c-api/exceptions.rst:446
+#: ../../c-api/exceptions.rst:459
msgid ""
":c:func:`PyErr_GetHandledException`, to save the exception currently being "
"handled."
msgstr ""
-#: ../../c-api/exceptions.rst:454
+#: ../../c-api/exceptions.rst:467
msgid ""
"Set *exc* as the exception currently being raised, clearing the existing "
"exception if one is set."
msgstr ""
-#: ../../c-api/exceptions.rst:459
+#: ../../c-api/exceptions.rst:472
msgid "This call steals a reference to *exc*, which must be a valid exception."
msgstr ""
-#: ../../c-api/exceptions.rst:468
+#: ../../c-api/exceptions.rst:481
msgid "Use :c:func:`PyErr_GetRaisedException` instead."
msgstr ""
-#: ../../c-api/exceptions.rst:470
+#: ../../c-api/exceptions.rst:483
msgid ""
"Retrieve the error indicator into three variables whose addresses are "
"passed. If the error indicator is not set, set all three variables to "
@@ -509,13 +518,13 @@ msgid ""
"the type object is not."
msgstr ""
-#: ../../c-api/exceptions.rst:477
+#: ../../c-api/exceptions.rst:490
msgid ""
"This function is normally only used by legacy code that needs to catch "
"exceptions or save and restore the error indicator temporarily."
msgstr ""
-#: ../../c-api/exceptions.rst:482
+#: ../../c-api/exceptions.rst:495
msgid ""
"{\n"
" PyObject *type, *value, *traceback;\n"
@@ -527,11 +536,11 @@ msgid ""
"}"
msgstr ""
-#: ../../c-api/exceptions.rst:496
+#: ../../c-api/exceptions.rst:509
msgid "Use :c:func:`PyErr_SetRaisedException` instead."
msgstr ""
-#: ../../c-api/exceptions.rst:498
+#: ../../c-api/exceptions.rst:511
msgid ""
"Set the error indicator from the three objects, *type*, *value*, and "
"*traceback*, clearing the existing exception if one is set. If the objects "
@@ -544,20 +553,20 @@ msgid ""
"don't use this function. I warned you.)"
msgstr ""
-#: ../../c-api/exceptions.rst:512
+#: ../../c-api/exceptions.rst:525
msgid ""
"This function is normally only used by legacy code that needs to save and "
"restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save "
"the current error indicator."
msgstr ""
-#: ../../c-api/exceptions.rst:521
+#: ../../c-api/exceptions.rst:534
msgid ""
"Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-"
"normalization."
msgstr ""
-#: ../../c-api/exceptions.rst:524
+#: ../../c-api/exceptions.rst:537
msgid ""
"Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` "
"below can be \"unnormalized\", meaning that ``*exc`` is a class object but "
@@ -567,14 +576,14 @@ msgid ""
"improve performance."
msgstr ""
-#: ../../c-api/exceptions.rst:532
+#: ../../c-api/exceptions.rst:545
msgid ""
"This function *does not* implicitly set the :attr:`~BaseException."
"__traceback__` attribute on the exception value. If setting the traceback "
"appropriately is desired, the following additional snippet is needed::"
msgstr ""
-#: ../../c-api/exceptions.rst:537
+#: ../../c-api/exceptions.rst:550
msgid ""
"if (tb != NULL) {\n"
" PyException_SetTraceback(val, tb);\n"
@@ -584,7 +593,7 @@ msgstr ""
" PyException_SetTraceback(val, tb);\n"
"}"
-#: ../../c-api/exceptions.rst:544
+#: ../../c-api/exceptions.rst:557
msgid ""
"Retrieve the active exception instance, as would be returned by :func:`sys."
"exception`. This refers to an exception that was *already caught*, not to an "
@@ -592,7 +601,7 @@ msgid ""
"or ``NULL``. Does not modify the interpreter's exception state."
msgstr ""
-#: ../../c-api/exceptions.rst:551
+#: ../../c-api/exceptions.rst:564
msgid ""
"This function is not normally used by code that wants to handle exceptions. "
"Rather, it can be used when code needs to save and restore the exception "
@@ -600,14 +609,14 @@ msgid ""
"clear the exception state."
msgstr ""
-#: ../../c-api/exceptions.rst:560
+#: ../../c-api/exceptions.rst:573
msgid ""
"Set the active exception, as known from ``sys.exception()``. This refers to "
"an exception that was *already caught*, not to an exception that was freshly "
"raised. To clear the exception state, pass ``NULL``."
msgstr ""
-#: ../../c-api/exceptions.rst:567
+#: ../../c-api/exceptions.rst:580
msgid ""
"This function is not normally used by code that wants to handle exceptions. "
"Rather, it can be used when code needs to save and restore the exception "
@@ -615,7 +624,7 @@ msgid ""
"exception state."
msgstr ""
-#: ../../c-api/exceptions.rst:576
+#: ../../c-api/exceptions.rst:589
msgid ""
"Retrieve the old-style representation of the exception info, as known from :"
"func:`sys.exc_info`. This refers to an exception that was *already caught*, "
@@ -625,7 +634,7 @@ msgid ""
"using :c:func:`PyErr_GetHandledException`."
msgstr ""
-#: ../../c-api/exceptions.rst:585
+#: ../../c-api/exceptions.rst:598
msgid ""
"This function is not normally used by code that wants to handle exceptions. "
"Rather, it can be used when code needs to save and restore the exception "
@@ -633,7 +642,7 @@ msgid ""
"exception state."
msgstr ""
-#: ../../c-api/exceptions.rst:595
+#: ../../c-api/exceptions.rst:608
msgid ""
"Set the exception info, as known from ``sys.exc_info()``. This refers to an "
"exception that was *already caught*, not to an exception that was freshly "
@@ -643,7 +652,7 @@ msgid ""
"`PyErr_SetHandledException`."
msgstr ""
-#: ../../c-api/exceptions.rst:604
+#: ../../c-api/exceptions.rst:617
msgid ""
"This function is not normally used by code that wants to handle exceptions. "
"Rather, it can be used when code needs to save and restore the exception "
@@ -651,22 +660,22 @@ msgid ""
"state."
msgstr ""
-#: ../../c-api/exceptions.rst:611
+#: ../../c-api/exceptions.rst:624
msgid ""
"The ``type`` and ``traceback`` arguments are no longer used and can be NULL. "
"The interpreter now derives them from the exception instance (the ``value`` "
"argument). The function still steals references of all three arguments."
msgstr ""
-#: ../../c-api/exceptions.rst:619
+#: ../../c-api/exceptions.rst:632
msgid "Signal Handling"
msgstr ""
-#: ../../c-api/exceptions.rst:629
+#: ../../c-api/exceptions.rst:642
msgid "This function interacts with Python's signal handling."
msgstr ""
-#: ../../c-api/exceptions.rst:631
+#: ../../c-api/exceptions.rst:644
msgid ""
"If the function is called from the main thread and under the main Python "
"interpreter, it checks whether a signal has been sent to the processes and "
@@ -674,7 +683,7 @@ msgid ""
"module is supported, this can invoke a signal handler written in Python."
msgstr ""
-#: ../../c-api/exceptions.rst:636
+#: ../../c-api/exceptions.rst:649
msgid ""
"The function attempts to handle all pending signals, and then returns ``0``. "
"However, if a Python signal handler raises an exception, the error indicator "
@@ -683,44 +692,44 @@ msgid ""
"`PyErr_CheckSignals()` invocation)."
msgstr ""
-#: ../../c-api/exceptions.rst:642
+#: ../../c-api/exceptions.rst:655
msgid ""
"If the function is called from a non-main thread, or under a non-main Python "
"interpreter, it does nothing and returns ``0``."
msgstr ""
-#: ../../c-api/exceptions.rst:645
+#: ../../c-api/exceptions.rst:658
msgid ""
"This function can be called by long-running C code that wants to be "
"interruptible by user requests (such as by pressing Ctrl-C)."
msgstr ""
-#: ../../c-api/exceptions.rst:649
+#: ../../c-api/exceptions.rst:662
msgid ""
"The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:"
"`KeyboardInterrupt` exception."
msgstr ""
-#: ../../c-api/exceptions.rst:660
+#: ../../c-api/exceptions.rst:673
msgid ""
"Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is "
"equivalent to ``PyErr_SetInterruptEx(SIGINT)``."
msgstr ""
-#: ../../c-api/exceptions.rst:664 ../../c-api/exceptions.rst:691
+#: ../../c-api/exceptions.rst:677 ../../c-api/exceptions.rst:704
msgid ""
"This function is async-signal-safe. It can be called without the :term:"
"`GIL` and from a C signal handler."
msgstr ""
-#: ../../c-api/exceptions.rst:674
+#: ../../c-api/exceptions.rst:687
msgid ""
"Simulate the effect of a signal arriving. The next time :c:func:"
"`PyErr_CheckSignals` is called, the Python signal handler for the given "
"signal number will be called."
msgstr ""
-#: ../../c-api/exceptions.rst:678
+#: ../../c-api/exceptions.rst:691
msgid ""
"This function can be called by C code that sets up its own signal handling "
"and wants Python signal handlers to be invoked as expected when an "
@@ -728,27 +737,27 @@ msgid ""
"interrupt an operation)."
msgstr ""
-#: ../../c-api/exceptions.rst:683
+#: ../../c-api/exceptions.rst:696
msgid ""
"If the given signal isn't handled by Python (it was set to :py:const:`signal."
"SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored."
msgstr ""
-#: ../../c-api/exceptions.rst:686
+#: ../../c-api/exceptions.rst:699
msgid ""
"If *signum* is outside of the allowed range of signal numbers, ``-1`` is "
"returned. Otherwise, ``0`` is returned. The error indicator is never "
"changed by this function."
msgstr ""
-#: ../../c-api/exceptions.rst:699
+#: ../../c-api/exceptions.rst:712
msgid ""
"This utility function specifies a file descriptor to which the signal number "
"is written as a single byte whenever a signal is received. *fd* must be non-"
"blocking. It returns the previous such file descriptor."
msgstr ""
-#: ../../c-api/exceptions.rst:703
+#: ../../c-api/exceptions.rst:716
msgid ""
"The value ``-1`` disables the feature; this is the initial state. This is "
"equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error "
@@ -756,15 +765,15 @@ msgid ""
"be called from the main thread."
msgstr ""
-#: ../../c-api/exceptions.rst:708
+#: ../../c-api/exceptions.rst:721
msgid "On Windows, the function now also supports socket handles."
msgstr ""
-#: ../../c-api/exceptions.rst:713
+#: ../../c-api/exceptions.rst:726
msgid "Exception Classes"
msgstr "例外類別"
-#: ../../c-api/exceptions.rst:717
+#: ../../c-api/exceptions.rst:730
msgid ""
"This utility function creates and returns a new exception class. The *name* "
"argument must be the name of the new exception, a C string of the form "
@@ -773,41 +782,41 @@ msgid ""
"(accessible in C as :c:data:`PyExc_Exception`)."
msgstr ""
-#: ../../c-api/exceptions.rst:723
+#: ../../c-api/exceptions.rst:736
msgid ""
-"The :attr:`!__module__` attribute of the new class is set to the first part "
-"(up to the last dot) of the *name* argument, and the class name is set to "
-"the last part (after the last dot). The *base* argument can be used to "
+"The :attr:`~type.__module__` attribute of the new class is set to the first "
+"part (up to the last dot) of the *name* argument, and the class name is set "
+"to the last part (after the last dot). The *base* argument can be used to "
"specify alternate base classes; it can either be only one class or a tuple "
"of classes. The *dict* argument can be used to specify a dictionary of class "
"variables and methods."
msgstr ""
-#: ../../c-api/exceptions.rst:732
+#: ../../c-api/exceptions.rst:745
msgid ""
"Same as :c:func:`PyErr_NewException`, except that the new exception class "
"can easily be given a docstring: If *doc* is non-``NULL``, it will be used "
"as the docstring for the exception class."
msgstr ""
-#: ../../c-api/exceptions.rst:740
+#: ../../c-api/exceptions.rst:753
msgid "Exception Objects"
msgstr "例外物件"
-#: ../../c-api/exceptions.rst:744
+#: ../../c-api/exceptions.rst:757
msgid ""
"Return the traceback associated with the exception as a new reference, as "
"accessible from Python through the :attr:`~BaseException.__traceback__` "
"attribute. If there is no traceback associated, this returns ``NULL``."
msgstr ""
-#: ../../c-api/exceptions.rst:752
+#: ../../c-api/exceptions.rst:765
msgid ""
"Set the traceback associated with the exception to *tb*. Use ``Py_None`` to "
"clear it."
msgstr ""
-#: ../../c-api/exceptions.rst:758
+#: ../../c-api/exceptions.rst:771
msgid ""
"Return the context (another exception instance during whose handling *ex* "
"was raised) associated with the exception as a new reference, as accessible "
@@ -815,14 +824,14 @@ msgid ""
"there is no context associated, this returns ``NULL``."
msgstr ""
-#: ../../c-api/exceptions.rst:766
+#: ../../c-api/exceptions.rst:779
msgid ""
"Set the context associated with the exception to *ctx*. Use ``NULL`` to "
"clear it. There is no type check to make sure that *ctx* is an exception "
"instance. This steals a reference to *ctx*."
msgstr ""
-#: ../../c-api/exceptions.rst:773
+#: ../../c-api/exceptions.rst:786
msgid ""
"Return the cause (either an exception instance, or ``None``, set by "
"``raise ... from ...``) associated with the exception as a new reference, as "
@@ -830,28 +839,28 @@ msgid ""
"attribute."
msgstr ""
-#: ../../c-api/exceptions.rst:781
+#: ../../c-api/exceptions.rst:794
msgid ""
"Set the cause associated with the exception to *cause*. Use ``NULL`` to "
"clear it. There is no type check to make sure that *cause* is either an "
"exception instance or ``None``. This steals a reference to *cause*."
msgstr ""
-#: ../../c-api/exceptions.rst:785
+#: ../../c-api/exceptions.rst:798
msgid ""
"The :attr:`~BaseException.__suppress_context__` attribute is implicitly set "
"to ``True`` by this function."
msgstr ""
-#: ../../c-api/exceptions.rst:791
+#: ../../c-api/exceptions.rst:804
msgid "Return :attr:`~BaseException.args` of exception *ex*."
msgstr ""
-#: ../../c-api/exceptions.rst:796
+#: ../../c-api/exceptions.rst:809
msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*."
msgstr ""
-#: ../../c-api/exceptions.rst:800
+#: ../../c-api/exceptions.rst:813
msgid ""
"Implement part of the interpreter's implementation of :keyword:`!except*`. "
"*orig* is the original exception that was caught, and *excs* is the list of "
@@ -863,72 +872,72 @@ msgid ""
"if there is nothing to reraise."
msgstr ""
-#: ../../c-api/exceptions.rst:814
+#: ../../c-api/exceptions.rst:827
msgid "Unicode Exception Objects"
msgstr ""
-#: ../../c-api/exceptions.rst:816
+#: ../../c-api/exceptions.rst:829
msgid ""
"The following functions are used to create and modify Unicode exceptions "
"from C."
msgstr ""
-#: ../../c-api/exceptions.rst:820
+#: ../../c-api/exceptions.rst:833
msgid ""
"Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, "
"*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are "
"UTF-8 encoded strings."
msgstr ""
-#: ../../c-api/exceptions.rst:827
+#: ../../c-api/exceptions.rst:840
msgid "Return the *encoding* attribute of the given exception object."
msgstr ""
-#: ../../c-api/exceptions.rst:833
+#: ../../c-api/exceptions.rst:846
msgid "Return the *object* attribute of the given exception object."
msgstr ""
-#: ../../c-api/exceptions.rst:839
+#: ../../c-api/exceptions.rst:852
msgid ""
"Get the *start* attribute of the given exception object and place it into "
"*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` "
"on failure."
msgstr ""
-#: ../../c-api/exceptions.rst:847
+#: ../../c-api/exceptions.rst:860
msgid ""
"Set the *start* attribute of the given exception object to *start*. Return "
"``0`` on success, ``-1`` on failure."
msgstr ""
-#: ../../c-api/exceptions.rst:854
+#: ../../c-api/exceptions.rst:867
msgid ""
"Get the *end* attribute of the given exception object and place it into "
"*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on "
"failure."
msgstr ""
-#: ../../c-api/exceptions.rst:862
+#: ../../c-api/exceptions.rst:875
msgid ""
"Set the *end* attribute of the given exception object to *end*. Return "
"``0`` on success, ``-1`` on failure."
msgstr ""
-#: ../../c-api/exceptions.rst:869
+#: ../../c-api/exceptions.rst:882
msgid "Return the *reason* attribute of the given exception object."
msgstr ""
-#: ../../c-api/exceptions.rst:875
+#: ../../c-api/exceptions.rst:888
msgid ""
"Set the *reason* attribute of the given exception object to *reason*. "
"Return ``0`` on success, ``-1`` on failure."
msgstr ""
-#: ../../c-api/exceptions.rst:882
+#: ../../c-api/exceptions.rst:895
msgid "Recursion Control"
msgstr ""
-#: ../../c-api/exceptions.rst:884
+#: ../../c-api/exceptions.rst:897
msgid ""
"These two functions provide a way to perform safe recursive calls at the C "
"level, both in the core and in extension modules. They are needed if the "
@@ -938,44 +947,44 @@ msgid ""
"recursion handling."
msgstr ""
-#: ../../c-api/exceptions.rst:893
+#: ../../c-api/exceptions.rst:906
msgid "Marks a point where a recursive C-level call is about to be performed."
msgstr ""
-#: ../../c-api/exceptions.rst:895
+#: ../../c-api/exceptions.rst:908
msgid ""
"If :c:macro:`!USE_STACKCHECK` is defined, this function checks if the OS "
"stack overflowed using :c:func:`PyOS_CheckStack`. If this is the case, it "
"sets a :exc:`MemoryError` and returns a nonzero value."
msgstr ""
-#: ../../c-api/exceptions.rst:899
+#: ../../c-api/exceptions.rst:912
msgid ""
"The function then checks if the recursion limit is reached. If this is the "
"case, a :exc:`RecursionError` is set and a nonzero value is returned. "
"Otherwise, zero is returned."
msgstr ""
-#: ../../c-api/exceptions.rst:903
+#: ../../c-api/exceptions.rst:916
msgid ""
"*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` "
"to be concatenated to the :exc:`RecursionError` message caused by the "
"recursion depth limit."
msgstr ""
-#: ../../c-api/exceptions.rst:907 ../../c-api/exceptions.rst:915
+#: ../../c-api/exceptions.rst:920 ../../c-api/exceptions.rst:928
msgid ""
"This function is now also available in the :ref:`limited API `."
msgstr ""
-#: ../../c-api/exceptions.rst:912
+#: ../../c-api/exceptions.rst:925
msgid ""
"Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each "
"*successful* invocation of :c:func:`Py_EnterRecursiveCall`."
msgstr ""
-#: ../../c-api/exceptions.rst:918
+#: ../../c-api/exceptions.rst:931
msgid ""
"Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types "
"requires special recursion handling. In addition to protecting the stack, :"
@@ -984,13 +993,13 @@ msgid ""
"Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`."
msgstr ""
-#: ../../c-api/exceptions.rst:926
+#: ../../c-api/exceptions.rst:939
msgid ""
"Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` "
"implementation to detect cycles."
msgstr ""
-#: ../../c-api/exceptions.rst:929
+#: ../../c-api/exceptions.rst:942
msgid ""
"If the object has already been processed, the function returns a positive "
"integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation "
@@ -998,30 +1007,30 @@ msgid ""
"`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``."
msgstr ""
-#: ../../c-api/exceptions.rst:935
+#: ../../c-api/exceptions.rst:948
msgid ""
"The function will return a negative integer if the recursion limit is "
"reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation "
"should typically return ``NULL``."
msgstr ""
-#: ../../c-api/exceptions.rst:939
+#: ../../c-api/exceptions.rst:952
msgid ""
"Otherwise, the function returns zero and the :c:member:`~PyTypeObject."
"tp_repr` implementation can continue normally."
msgstr ""
-#: ../../c-api/exceptions.rst:944
+#: ../../c-api/exceptions.rst:957
msgid ""
"Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :"
"c:func:`Py_ReprEnter` that returns zero."
msgstr ""
-#: ../../c-api/exceptions.rst:951
+#: ../../c-api/exceptions.rst:964
msgid "Standard Exceptions"
msgstr ""
-#: ../../c-api/exceptions.rst:953
+#: ../../c-api/exceptions.rst:966
msgid ""
"All standard Python exceptions are available as global variables whose names "
"are ``PyExc_`` followed by the Python exception name. These have the type :"
@@ -1029,451 +1038,459 @@ msgid ""
"all the variables:"
msgstr ""
-#: ../../c-api/exceptions.rst:1014 ../../c-api/exceptions.rst:1147
-#: ../../c-api/exceptions.rst:1192
+#: ../../c-api/exceptions.rst:1028 ../../c-api/exceptions.rst:1163
+#: ../../c-api/exceptions.rst:1208
msgid "C Name"
msgstr "C 名稱"
-#: ../../c-api/exceptions.rst:1014 ../../c-api/exceptions.rst:1192
+#: ../../c-api/exceptions.rst:1028 ../../c-api/exceptions.rst:1208
msgid "Python Name"
msgstr "Python 名稱"
-#: ../../c-api/exceptions.rst:1014 ../../c-api/exceptions.rst:1147
-#: ../../c-api/exceptions.rst:1192
+#: ../../c-api/exceptions.rst:1028 ../../c-api/exceptions.rst:1163
+#: ../../c-api/exceptions.rst:1208
msgid "Notes"
msgstr "註解"
-#: ../../c-api/exceptions.rst:1016
+#: ../../c-api/exceptions.rst:1030
msgid ":c:data:`PyExc_BaseException`"
msgstr ":c:data:`PyExc_BaseException`"
-#: ../../c-api/exceptions.rst:1016
+#: ../../c-api/exceptions.rst:1030
msgid ":exc:`BaseException`"
msgstr ":exc:`BaseException`"
-#: ../../c-api/exceptions.rst:1016 ../../c-api/exceptions.rst:1018
-#: ../../c-api/exceptions.rst:1020 ../../c-api/exceptions.rst:1066
-#: ../../c-api/exceptions.rst:1078
+#: ../../c-api/exceptions.rst:1030 ../../c-api/exceptions.rst:1032
+#: ../../c-api/exceptions.rst:1034 ../../c-api/exceptions.rst:1080
+#: ../../c-api/exceptions.rst:1092
msgid "[1]_"
msgstr "[1]_"
-#: ../../c-api/exceptions.rst:1018
+#: ../../c-api/exceptions.rst:1032
msgid ":c:data:`PyExc_Exception`"
msgstr ":c:data:`PyExc_Exception`"
-#: ../../c-api/exceptions.rst:1018
+#: ../../c-api/exceptions.rst:1032
msgid ":exc:`Exception`"
msgstr ":exc:`Exception`"
-#: ../../c-api/exceptions.rst:1020
+#: ../../c-api/exceptions.rst:1034
msgid ":c:data:`PyExc_ArithmeticError`"
msgstr ":c:data:`PyExc_ArithmeticError`"
-#: ../../c-api/exceptions.rst:1020
+#: ../../c-api/exceptions.rst:1034
msgid ":exc:`ArithmeticError`"
msgstr ":exc:`ArithmeticError`"
-#: ../../c-api/exceptions.rst:1022
+#: ../../c-api/exceptions.rst:1036
msgid ":c:data:`PyExc_AssertionError`"
msgstr ":c:data:`PyExc_AssertionError`"
-#: ../../c-api/exceptions.rst:1022
+#: ../../c-api/exceptions.rst:1036
msgid ":exc:`AssertionError`"
msgstr ":exc:`AssertionError`"
-#: ../../c-api/exceptions.rst:1024
+#: ../../c-api/exceptions.rst:1038
msgid ":c:data:`PyExc_AttributeError`"
msgstr ":c:data:`PyExc_AttributeError`"
-#: ../../c-api/exceptions.rst:1024
+#: ../../c-api/exceptions.rst:1038
msgid ":exc:`AttributeError`"
msgstr ":exc:`AttributeError`"
-#: ../../c-api/exceptions.rst:1026
+#: ../../c-api/exceptions.rst:1040
msgid ":c:data:`PyExc_BlockingIOError`"
msgstr ":c:data:`PyExc_BlockingIOError`"
-#: ../../c-api/exceptions.rst:1026
+#: ../../c-api/exceptions.rst:1040
msgid ":exc:`BlockingIOError`"
msgstr ":exc:`BlockingIOError`"
-#: ../../c-api/exceptions.rst:1028
+#: ../../c-api/exceptions.rst:1042
msgid ":c:data:`PyExc_BrokenPipeError`"
msgstr ":c:data:`PyExc_BrokenPipeError`"
-#: ../../c-api/exceptions.rst:1028
+#: ../../c-api/exceptions.rst:1042
msgid ":exc:`BrokenPipeError`"
msgstr ":exc:`BrokenPipeError`"
-#: ../../c-api/exceptions.rst:1030
+#: ../../c-api/exceptions.rst:1044
msgid ":c:data:`PyExc_BufferError`"
msgstr ":c:data:`PyExc_BufferError`"
-#: ../../c-api/exceptions.rst:1030
+#: ../../c-api/exceptions.rst:1044
msgid ":exc:`BufferError`"
msgstr ":exc:`BufferError`"
-#: ../../c-api/exceptions.rst:1032
+#: ../../c-api/exceptions.rst:1046
msgid ":c:data:`PyExc_ChildProcessError`"
msgstr ":c:data:`PyExc_ChildProcessError`"
-#: ../../c-api/exceptions.rst:1032
+#: ../../c-api/exceptions.rst:1046
msgid ":exc:`ChildProcessError`"
msgstr ":exc:`ChildProcessError`"
-#: ../../c-api/exceptions.rst:1034
+#: ../../c-api/exceptions.rst:1048
msgid ":c:data:`PyExc_ConnectionAbortedError`"
msgstr ":c:data:`PyExc_ConnectionAbortedError`"
-#: ../../c-api/exceptions.rst:1034
+#: ../../c-api/exceptions.rst:1048
msgid ":exc:`ConnectionAbortedError`"
msgstr ":exc:`ConnectionAbortedError`"
-#: ../../c-api/exceptions.rst:1036
+#: ../../c-api/exceptions.rst:1050
msgid ":c:data:`PyExc_ConnectionError`"
msgstr ":c:data:`PyExc_ConnectionError`"
-#: ../../c-api/exceptions.rst:1036
+#: ../../c-api/exceptions.rst:1050
msgid ":exc:`ConnectionError`"
msgstr ":exc:`ConnectionError`"
-#: ../../c-api/exceptions.rst:1038
+#: ../../c-api/exceptions.rst:1052
msgid ":c:data:`PyExc_ConnectionRefusedError`"
msgstr ":c:data:`PyExc_ConnectionRefusedError`"
-#: ../../c-api/exceptions.rst:1038
+#: ../../c-api/exceptions.rst:1052
msgid ":exc:`ConnectionRefusedError`"
msgstr ":exc:`ConnectionRefusedError`"
-#: ../../c-api/exceptions.rst:1040
+#: ../../c-api/exceptions.rst:1054
msgid ":c:data:`PyExc_ConnectionResetError`"
msgstr ":c:data:`PyExc_ConnectionResetError`"
-#: ../../c-api/exceptions.rst:1040
+#: ../../c-api/exceptions.rst:1054
msgid ":exc:`ConnectionResetError`"
msgstr ":exc:`ConnectionResetError`"
-#: ../../c-api/exceptions.rst:1042
+#: ../../c-api/exceptions.rst:1056
msgid ":c:data:`PyExc_EOFError`"
msgstr ":c:data:`PyExc_EOFError`"
-#: ../../c-api/exceptions.rst:1042
+#: ../../c-api/exceptions.rst:1056
msgid ":exc:`EOFError`"
msgstr ":exc:`EOFError`"
-#: ../../c-api/exceptions.rst:1044
+#: ../../c-api/exceptions.rst:1058
msgid ":c:data:`PyExc_FileExistsError`"
msgstr ":c:data:`PyExc_FileExistsError`"
-#: ../../c-api/exceptions.rst:1044
+#: ../../c-api/exceptions.rst:1058
msgid ":exc:`FileExistsError`"
msgstr ":exc:`FileExistsError`"
-#: ../../c-api/exceptions.rst:1046
+#: ../../c-api/exceptions.rst:1060
msgid ":c:data:`PyExc_FileNotFoundError`"
msgstr ":c:data:`PyExc_FileNotFoundError`"
-#: ../../c-api/exceptions.rst:1046
+#: ../../c-api/exceptions.rst:1060
msgid ":exc:`FileNotFoundError`"
msgstr ":exc:`FileNotFoundError`"
-#: ../../c-api/exceptions.rst:1048
+#: ../../c-api/exceptions.rst:1062
msgid ":c:data:`PyExc_FloatingPointError`"
msgstr ":c:data:`PyExc_FloatingPointError`"
-#: ../../c-api/exceptions.rst:1048
+#: ../../c-api/exceptions.rst:1062
msgid ":exc:`FloatingPointError`"
msgstr ":exc:`FloatingPointError`"
-#: ../../c-api/exceptions.rst:1050
+#: ../../c-api/exceptions.rst:1064
msgid ":c:data:`PyExc_GeneratorExit`"
msgstr ":c:data:`PyExc_GeneratorExit`"
-#: ../../c-api/exceptions.rst:1050
+#: ../../c-api/exceptions.rst:1064
msgid ":exc:`GeneratorExit`"
msgstr ":exc:`GeneratorExit`"
-#: ../../c-api/exceptions.rst:1052
+#: ../../c-api/exceptions.rst:1066
msgid ":c:data:`PyExc_ImportError`"
msgstr ":c:data:`PyExc_ImportError`"
-#: ../../c-api/exceptions.rst:1052
+#: ../../c-api/exceptions.rst:1066
msgid ":exc:`ImportError`"
msgstr ":exc:`ImportError`"
-#: ../../c-api/exceptions.rst:1054
+#: ../../c-api/exceptions.rst:1068
msgid ":c:data:`PyExc_IndentationError`"
msgstr ":c:data:`PyExc_IndentationError`"
-#: ../../c-api/exceptions.rst:1054
+#: ../../c-api/exceptions.rst:1068
msgid ":exc:`IndentationError`"
msgstr ":exc:`IndentationError`"
-#: ../../c-api/exceptions.rst:1056
+#: ../../c-api/exceptions.rst:1070
msgid ":c:data:`PyExc_IndexError`"
msgstr ":c:data:`PyExc_IndexError`"
-#: ../../c-api/exceptions.rst:1056
+#: ../../c-api/exceptions.rst:1070
msgid ":exc:`IndexError`"
msgstr ":exc:`IndexError`"
-#: ../../c-api/exceptions.rst:1058
+#: ../../c-api/exceptions.rst:1072
msgid ":c:data:`PyExc_InterruptedError`"
msgstr ":c:data:`PyExc_InterruptedError`"
-#: ../../c-api/exceptions.rst:1058
+#: ../../c-api/exceptions.rst:1072
msgid ":exc:`InterruptedError`"
msgstr ":exc:`InterruptedError`"
-#: ../../c-api/exceptions.rst:1060
+#: ../../c-api/exceptions.rst:1074
msgid ":c:data:`PyExc_IsADirectoryError`"
msgstr ":c:data:`PyExc_IsADirectoryError`"
-#: ../../c-api/exceptions.rst:1060
+#: ../../c-api/exceptions.rst:1074
msgid ":exc:`IsADirectoryError`"
msgstr ":exc:`IsADirectoryError`"
-#: ../../c-api/exceptions.rst:1062
+#: ../../c-api/exceptions.rst:1076
msgid ":c:data:`PyExc_KeyError`"
msgstr ":c:data:`PyExc_KeyError`"
-#: ../../c-api/exceptions.rst:1062
+#: ../../c-api/exceptions.rst:1076
msgid ":exc:`KeyError`"
msgstr ":exc:`KeyError`"
-#: ../../c-api/exceptions.rst:1064
+#: ../../c-api/exceptions.rst:1078
msgid ":c:data:`PyExc_KeyboardInterrupt`"
msgstr ":c:data:`PyExc_KeyboardInterrupt`"
-#: ../../c-api/exceptions.rst:1064
+#: ../../c-api/exceptions.rst:1078
msgid ":exc:`KeyboardInterrupt`"
msgstr ":exc:`KeyboardInterrupt`"
-#: ../../c-api/exceptions.rst:1066
+#: ../../c-api/exceptions.rst:1080
msgid ":c:data:`PyExc_LookupError`"
msgstr ":c:data:`PyExc_LookupError`"
-#: ../../c-api/exceptions.rst:1066
+#: ../../c-api/exceptions.rst:1080
msgid ":exc:`LookupError`"
msgstr ":exc:`LookupError`"
-#: ../../c-api/exceptions.rst:1068
+#: ../../c-api/exceptions.rst:1082
msgid ":c:data:`PyExc_MemoryError`"
msgstr ":c:data:`PyExc_MemoryError`"
-#: ../../c-api/exceptions.rst:1068
+#: ../../c-api/exceptions.rst:1082
msgid ":exc:`MemoryError`"
msgstr ":exc:`MemoryError`"
-#: ../../c-api/exceptions.rst:1070
+#: ../../c-api/exceptions.rst:1084
msgid ":c:data:`PyExc_ModuleNotFoundError`"
msgstr ":c:data:`PyExc_ModuleNotFoundError`"
-#: ../../c-api/exceptions.rst:1070
+#: ../../c-api/exceptions.rst:1084
msgid ":exc:`ModuleNotFoundError`"
msgstr ":exc:`ModuleNotFoundError`"
-#: ../../c-api/exceptions.rst:1072
+#: ../../c-api/exceptions.rst:1086
msgid ":c:data:`PyExc_NameError`"
msgstr ":c:data:`PyExc_NameError`"
-#: ../../c-api/exceptions.rst:1072
+#: ../../c-api/exceptions.rst:1086
msgid ":exc:`NameError`"
msgstr ":exc:`NameError`"
-#: ../../c-api/exceptions.rst:1074
+#: ../../c-api/exceptions.rst:1088
msgid ":c:data:`PyExc_NotADirectoryError`"
msgstr ":c:data:`PyExc_NotADirectoryError`"
-#: ../../c-api/exceptions.rst:1074
+#: ../../c-api/exceptions.rst:1088
msgid ":exc:`NotADirectoryError`"
msgstr ":exc:`NotADirectoryError`"
-#: ../../c-api/exceptions.rst:1076
+#: ../../c-api/exceptions.rst:1090
msgid ":c:data:`PyExc_NotImplementedError`"
msgstr ":c:data:`PyExc_NotImplementedError`"
-#: ../../c-api/exceptions.rst:1076
+#: ../../c-api/exceptions.rst:1090
msgid ":exc:`NotImplementedError`"
msgstr ":exc:`NotImplementedError`"
-#: ../../c-api/exceptions.rst:1078
+#: ../../c-api/exceptions.rst:1092
msgid ":c:data:`PyExc_OSError`"
msgstr ":c:data:`PyExc_OSError`"
-#: ../../c-api/exceptions.rst:1078
+#: ../../c-api/exceptions.rst:1092
msgid ":exc:`OSError`"
msgstr ":exc:`OSError`"
-#: ../../c-api/exceptions.rst:1080
+#: ../../c-api/exceptions.rst:1094
msgid ":c:data:`PyExc_OverflowError`"
msgstr ":c:data:`PyExc_OverflowError`"
-#: ../../c-api/exceptions.rst:1080
+#: ../../c-api/exceptions.rst:1094
msgid ":exc:`OverflowError`"
msgstr ":exc:`OverflowError`"
-#: ../../c-api/exceptions.rst:1082
+#: ../../c-api/exceptions.rst:1096
msgid ":c:data:`PyExc_PermissionError`"
msgstr ":c:data:`PyExc_PermissionError`"
-#: ../../c-api/exceptions.rst:1082
+#: ../../c-api/exceptions.rst:1096
msgid ":exc:`PermissionError`"
msgstr ":exc:`PermissionError`"
-#: ../../c-api/exceptions.rst:1084
+#: ../../c-api/exceptions.rst:1098
msgid ":c:data:`PyExc_ProcessLookupError`"
msgstr ":c:data:`PyExc_ProcessLookupError`"
-#: ../../c-api/exceptions.rst:1084
+#: ../../c-api/exceptions.rst:1098
msgid ":exc:`ProcessLookupError`"
msgstr ":exc:`ProcessLookupError`"
-#: ../../c-api/exceptions.rst:1086
+#: ../../c-api/exceptions.rst:1100
+msgid ":c:data:`PyExc_PythonFinalizationError`"
+msgstr ":c:data:`PyExc_PythonFinalizationError`"
+
+#: ../../c-api/exceptions.rst:1100
+msgid ":exc:`PythonFinalizationError`"
+msgstr ":exc:`PythonFinalizationError`"
+
+#: ../../c-api/exceptions.rst:1102
msgid ":c:data:`PyExc_RecursionError`"
msgstr ":c:data:`PyExc_RecursionError`"
-#: ../../c-api/exceptions.rst:1086
+#: ../../c-api/exceptions.rst:1102
msgid ":exc:`RecursionError`"
msgstr ":exc:`RecursionError`"
-#: ../../c-api/exceptions.rst:1088
+#: ../../c-api/exceptions.rst:1104
msgid ":c:data:`PyExc_ReferenceError`"
msgstr ":c:data:`PyExc_ReferenceError`"
-#: ../../c-api/exceptions.rst:1088
+#: ../../c-api/exceptions.rst:1104
msgid ":exc:`ReferenceError`"
msgstr ":exc:`ReferenceError`"
-#: ../../c-api/exceptions.rst:1090
+#: ../../c-api/exceptions.rst:1106
msgid ":c:data:`PyExc_RuntimeError`"
msgstr ":c:data:`PyExc_RuntimeError`"
-#: ../../c-api/exceptions.rst:1090
+#: ../../c-api/exceptions.rst:1106
msgid ":exc:`RuntimeError`"
msgstr ":exc:`RuntimeError`"
-#: ../../c-api/exceptions.rst:1092
+#: ../../c-api/exceptions.rst:1108
msgid ":c:data:`PyExc_StopAsyncIteration`"
msgstr ":c:data:`PyExc_StopAsyncIteration`"
-#: ../../c-api/exceptions.rst:1092
+#: ../../c-api/exceptions.rst:1108
msgid ":exc:`StopAsyncIteration`"
msgstr ":exc:`StopAsyncIteration`"
-#: ../../c-api/exceptions.rst:1094
+#: ../../c-api/exceptions.rst:1110
msgid ":c:data:`PyExc_StopIteration`"
msgstr ":c:data:`PyExc_StopIteration`"
-#: ../../c-api/exceptions.rst:1094
+#: ../../c-api/exceptions.rst:1110
msgid ":exc:`StopIteration`"
msgstr ":exc:`StopIteration`"
-#: ../../c-api/exceptions.rst:1096
+#: ../../c-api/exceptions.rst:1112
msgid ":c:data:`PyExc_SyntaxError`"
msgstr ":c:data:`PyExc_SyntaxError`"
-#: ../../c-api/exceptions.rst:1096
+#: ../../c-api/exceptions.rst:1112
msgid ":exc:`SyntaxError`"
msgstr ":exc:`SyntaxError`"
-#: ../../c-api/exceptions.rst:1098
+#: ../../c-api/exceptions.rst:1114
msgid ":c:data:`PyExc_SystemError`"
msgstr ":c:data:`PyExc_SystemError`"
-#: ../../c-api/exceptions.rst:1098
+#: ../../c-api/exceptions.rst:1114
msgid ":exc:`SystemError`"
msgstr ":exc:`SystemError`"
-#: ../../c-api/exceptions.rst:1100
+#: ../../c-api/exceptions.rst:1116
msgid ":c:data:`PyExc_SystemExit`"
msgstr ":c:data:`PyExc_SystemExit`"
-#: ../../c-api/exceptions.rst:1100
+#: ../../c-api/exceptions.rst:1116
msgid ":exc:`SystemExit`"
msgstr ":exc:`SystemExit`"
-#: ../../c-api/exceptions.rst:1102
+#: ../../c-api/exceptions.rst:1118
msgid ":c:data:`PyExc_TabError`"
msgstr ":c:data:`PyExc_TabError`"
-#: ../../c-api/exceptions.rst:1102
+#: ../../c-api/exceptions.rst:1118
msgid ":exc:`TabError`"
msgstr ":exc:`TabError`"
-#: ../../c-api/exceptions.rst:1104
+#: ../../c-api/exceptions.rst:1120
msgid ":c:data:`PyExc_TimeoutError`"
msgstr ":c:data:`PyExc_TimeoutError`"
-#: ../../c-api/exceptions.rst:1104
+#: ../../c-api/exceptions.rst:1120
msgid ":exc:`TimeoutError`"
msgstr ":exc:`TimeoutError`"
-#: ../../c-api/exceptions.rst:1106
+#: ../../c-api/exceptions.rst:1122
msgid ":c:data:`PyExc_TypeError`"
msgstr ":c:data:`PyExc_TypeError`"
-#: ../../c-api/exceptions.rst:1106
+#: ../../c-api/exceptions.rst:1122
msgid ":exc:`TypeError`"
msgstr ":exc:`TypeError`"
-#: ../../c-api/exceptions.rst:1108
+#: ../../c-api/exceptions.rst:1124
msgid ":c:data:`PyExc_UnboundLocalError`"
msgstr ":c:data:`PyExc_UnboundLocalError`"
-#: ../../c-api/exceptions.rst:1108
+#: ../../c-api/exceptions.rst:1124
msgid ":exc:`UnboundLocalError`"
msgstr ":exc:`UnboundLocalError`"
-#: ../../c-api/exceptions.rst:1110
+#: ../../c-api/exceptions.rst:1126
msgid ":c:data:`PyExc_UnicodeDecodeError`"
msgstr ":c:data:`PyExc_UnicodeDecodeError`"
-#: ../../c-api/exceptions.rst:1110
+#: ../../c-api/exceptions.rst:1126
msgid ":exc:`UnicodeDecodeError`"
msgstr ":exc:`UnicodeDecodeError`"
-#: ../../c-api/exceptions.rst:1112
+#: ../../c-api/exceptions.rst:1128
msgid ":c:data:`PyExc_UnicodeEncodeError`"
msgstr ":c:data:`PyExc_UnicodeEncodeError`"
-#: ../../c-api/exceptions.rst:1112
+#: ../../c-api/exceptions.rst:1128
msgid ":exc:`UnicodeEncodeError`"
msgstr ":exc:`UnicodeEncodeError`"
-#: ../../c-api/exceptions.rst:1114
+#: ../../c-api/exceptions.rst:1130
msgid ":c:data:`PyExc_UnicodeError`"
msgstr ":c:data:`PyExc_UnicodeError`"
-#: ../../c-api/exceptions.rst:1114
+#: ../../c-api/exceptions.rst:1130
msgid ":exc:`UnicodeError`"
msgstr ":exc:`UnicodeError`"
-#: ../../c-api/exceptions.rst:1116
+#: ../../c-api/exceptions.rst:1132
msgid ":c:data:`PyExc_UnicodeTranslateError`"
msgstr ":c:data:`PyExc_UnicodeTranslateError`"
-#: ../../c-api/exceptions.rst:1116
+#: ../../c-api/exceptions.rst:1132
msgid ":exc:`UnicodeTranslateError`"
msgstr ":exc:`UnicodeTranslateError`"
-#: ../../c-api/exceptions.rst:1118
+#: ../../c-api/exceptions.rst:1134
msgid ":c:data:`PyExc_ValueError`"
msgstr ":c:data:`PyExc_ValueError`"
-#: ../../c-api/exceptions.rst:1118
+#: ../../c-api/exceptions.rst:1134
msgid ":exc:`ValueError`"
msgstr ":exc:`ValueError`"
-#: ../../c-api/exceptions.rst:1120
+#: ../../c-api/exceptions.rst:1136
msgid ":c:data:`PyExc_ZeroDivisionError`"
msgstr ":c:data:`PyExc_ZeroDivisionError`"
-#: ../../c-api/exceptions.rst:1120
+#: ../../c-api/exceptions.rst:1136
msgid ":exc:`ZeroDivisionError`"
msgstr ":exc:`ZeroDivisionError`"
-#: ../../c-api/exceptions.rst:1123
+#: ../../c-api/exceptions.rst:1139
msgid ""
":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:"
"`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:"
@@ -1493,57 +1510,57 @@ msgstr ""
"`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:"
"`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。"
-#: ../../c-api/exceptions.rst:1133
+#: ../../c-api/exceptions.rst:1149
msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`."
msgstr ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`。"
-#: ../../c-api/exceptions.rst:1136
+#: ../../c-api/exceptions.rst:1152
msgid ":c:data:`PyExc_ModuleNotFoundError`."
msgstr ":c:data:`PyExc_ModuleNotFoundError`。"
-#: ../../c-api/exceptions.rst:1139
+#: ../../c-api/exceptions.rst:1155
msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:"
msgstr ""
-#: ../../c-api/exceptions.rst:1149
+#: ../../c-api/exceptions.rst:1165
msgid ":c:data:`!PyExc_EnvironmentError`"
msgstr ":c:data:`!PyExc_EnvironmentError`"
-#: ../../c-api/exceptions.rst:1151
+#: ../../c-api/exceptions.rst:1167
msgid ":c:data:`!PyExc_IOError`"
msgstr ":c:data:`!PyExc_IOError`"
-#: ../../c-api/exceptions.rst:1153
+#: ../../c-api/exceptions.rst:1169
msgid ":c:data:`!PyExc_WindowsError`"
msgstr ":c:data:`!PyExc_WindowsError`"
-#: ../../c-api/exceptions.rst:1153
+#: ../../c-api/exceptions.rst:1169
msgid "[2]_"
msgstr "[2]_"
-#: ../../c-api/exceptions.rst:1156
+#: ../../c-api/exceptions.rst:1172
msgid "These aliases used to be separate exception types."
msgstr ""
-#: ../../c-api/exceptions.rst:1159 ../../c-api/exceptions.rst:1220
+#: ../../c-api/exceptions.rst:1175 ../../c-api/exceptions.rst:1236
msgid "Notes:"
msgstr "註解:"
-#: ../../c-api/exceptions.rst:1162
+#: ../../c-api/exceptions.rst:1178
msgid "This is a base class for other standard exceptions."
msgstr ""
-#: ../../c-api/exceptions.rst:1165
+#: ../../c-api/exceptions.rst:1181
msgid ""
"Only defined on Windows; protect code that uses this by testing that the "
"preprocessor macro ``MS_WINDOWS`` is defined."
msgstr ""
-#: ../../c-api/exceptions.rst:1171
+#: ../../c-api/exceptions.rst:1187
msgid "Standard Warning Categories"
msgstr ""
-#: ../../c-api/exceptions.rst:1173
+#: ../../c-api/exceptions.rst:1189
msgid ""
"All standard Python warning categories are available as global variables "
"whose names are ``PyExc_`` followed by the Python exception name. These have "
@@ -1551,393 +1568,397 @@ msgid ""
"here are all the variables:"
msgstr ""
-#: ../../c-api/exceptions.rst:1194
+#: ../../c-api/exceptions.rst:1210
msgid ":c:data:`PyExc_Warning`"
msgstr ":c:data:`PyExc_Warning`"
-#: ../../c-api/exceptions.rst:1194
+#: ../../c-api/exceptions.rst:1210
msgid ":exc:`Warning`"
msgstr ":exc:`Warning`"
-#: ../../c-api/exceptions.rst:1194
+#: ../../c-api/exceptions.rst:1210
msgid "[3]_"
msgstr "[3]_"
-#: ../../c-api/exceptions.rst:1196
+#: ../../c-api/exceptions.rst:1212
msgid ":c:data:`PyExc_BytesWarning`"
msgstr ":c:data:`PyExc_BytesWarning`"
-#: ../../c-api/exceptions.rst:1196
+#: ../../c-api/exceptions.rst:1212
msgid ":exc:`BytesWarning`"
msgstr ":exc:`BytesWarning`"
-#: ../../c-api/exceptions.rst:1198
+#: ../../c-api/exceptions.rst:1214
msgid ":c:data:`PyExc_DeprecationWarning`"
msgstr ":c:data:`PyExc_DeprecationWarning`"
-#: ../../c-api/exceptions.rst:1198
+#: ../../c-api/exceptions.rst:1214
msgid ":exc:`DeprecationWarning`"
msgstr ":exc:`DeprecationWarning`"
-#: ../../c-api/exceptions.rst:1200
+#: ../../c-api/exceptions.rst:1216
msgid ":c:data:`PyExc_FutureWarning`"
msgstr ":c:data:`PyExc_FutureWarning`"
-#: ../../c-api/exceptions.rst:1200
+#: ../../c-api/exceptions.rst:1216
msgid ":exc:`FutureWarning`"
msgstr ":exc:`FutureWarning`"
-#: ../../c-api/exceptions.rst:1202
+#: ../../c-api/exceptions.rst:1218
msgid ":c:data:`PyExc_ImportWarning`"
msgstr ":c:data:`PyExc_ImportWarning`"
-#: ../../c-api/exceptions.rst:1202
+#: ../../c-api/exceptions.rst:1218
msgid ":exc:`ImportWarning`"
msgstr ":exc:`ImportWarning`"
-#: ../../c-api/exceptions.rst:1204
+#: ../../c-api/exceptions.rst:1220
msgid ":c:data:`PyExc_PendingDeprecationWarning`"
msgstr ":c:data:`PyExc_PendingDeprecationWarning`"
-#: ../../c-api/exceptions.rst:1204
+#: ../../c-api/exceptions.rst:1220
msgid ":exc:`PendingDeprecationWarning`"
msgstr ":exc:`PendingDeprecationWarning`"
-#: ../../c-api/exceptions.rst:1206
+#: ../../c-api/exceptions.rst:1222
msgid ":c:data:`PyExc_ResourceWarning`"
msgstr ":c:data:`PyExc_ResourceWarning`"
-#: ../../c-api/exceptions.rst:1206
+#: ../../c-api/exceptions.rst:1222
msgid ":exc:`ResourceWarning`"
msgstr ":exc:`ResourceWarning`"
-#: ../../c-api/exceptions.rst:1208
+#: ../../c-api/exceptions.rst:1224
msgid ":c:data:`PyExc_RuntimeWarning`"
msgstr ":c:data:`PyExc_RuntimeWarning`"
-#: ../../c-api/exceptions.rst:1208
+#: ../../c-api/exceptions.rst:1224
msgid ":exc:`RuntimeWarning`"
msgstr ":exc:`RuntimeWarning`"
-#: ../../c-api/exceptions.rst:1210
+#: ../../c-api/exceptions.rst:1226
msgid ":c:data:`PyExc_SyntaxWarning`"
msgstr ":c:data:`PyExc_SyntaxWarning`"
-#: ../../c-api/exceptions.rst:1210
+#: ../../c-api/exceptions.rst:1226
msgid ":exc:`SyntaxWarning`"
msgstr ":exc:`SyntaxWarning`"
-#: ../../c-api/exceptions.rst:1212
+#: ../../c-api/exceptions.rst:1228
msgid ":c:data:`PyExc_UnicodeWarning`"
msgstr ":c:data:`PyExc_UnicodeWarning`"
-#: ../../c-api/exceptions.rst:1212
+#: ../../c-api/exceptions.rst:1228
msgid ":exc:`UnicodeWarning`"
msgstr ":exc:`UnicodeWarning`"
-#: ../../c-api/exceptions.rst:1214
+#: ../../c-api/exceptions.rst:1230
msgid ":c:data:`PyExc_UserWarning`"
msgstr ":c:data:`PyExc_UserWarning`"
-#: ../../c-api/exceptions.rst:1214
+#: ../../c-api/exceptions.rst:1230
msgid ":exc:`UserWarning`"
msgstr ":exc:`UserWarning`"
-#: ../../c-api/exceptions.rst:1217
+#: ../../c-api/exceptions.rst:1233
msgid ":c:data:`PyExc_ResourceWarning`."
msgstr ":c:data:`PyExc_ResourceWarning`."
-#: ../../c-api/exceptions.rst:1223
+#: ../../c-api/exceptions.rst:1239
msgid "This is a base class for other standard warning categories."
msgstr ""
-#: ../../c-api/exceptions.rst:170
+#: ../../c-api/exceptions.rst:183
msgid "strerror (C function)"
msgstr "strerror(C 函式)"
-#: ../../c-api/exceptions.rst:624 ../../c-api/exceptions.rst:655
-#: ../../c-api/exceptions.rst:670
+#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668
+#: ../../c-api/exceptions.rst:683
msgid "module"
msgstr "module(模組)"
-#: ../../c-api/exceptions.rst:624 ../../c-api/exceptions.rst:655
-#: ../../c-api/exceptions.rst:670
+#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668
+#: ../../c-api/exceptions.rst:683
msgid "signal"
msgstr "signal(訊號)"
-#: ../../c-api/exceptions.rst:624 ../../c-api/exceptions.rst:655
+#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668
msgid "SIGINT (C macro)"
msgstr "SIGINT(C 巨集)"
-#: ../../c-api/exceptions.rst:624 ../../c-api/exceptions.rst:655
-#: ../../c-api/exceptions.rst:670
+#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668
+#: ../../c-api/exceptions.rst:683
msgid "KeyboardInterrupt (built-in exception)"
msgstr "KeyboardInterrupt(內建例外)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_BaseException (C var)"
msgstr "PyExc_BaseException(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_Exception (C var)"
msgstr "PyExc_Exception(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ArithmeticError (C var)"
msgstr "PyExc_ArithmeticError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_AssertionError (C var)"
msgstr "PyExc_AssertionError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_AttributeError (C var)"
msgstr "PyExc_AttributeError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_BlockingIOError (C var)"
msgstr "PyExc_BlockingIOError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_BrokenPipeError (C var)"
msgstr "PyExc_BrokenPipeError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_BufferError (C var)"
msgstr "PyExc_BufferError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ChildProcessError (C var)"
msgstr "PyExc_ChildProcessError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ConnectionAbortedError (C var)"
msgstr "PyExc_ConnectionAbortedError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ConnectionError (C var)"
msgstr "PyExc_ConnectionError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ConnectionRefusedError (C var)"
msgstr "PyExc_ConnectionRefusedError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ConnectionResetError (C var)"
msgstr "PyExc_ConnectionResetError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_EOFError (C var)"
msgstr "PyExc_EOFError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_FileExistsError (C var)"
msgstr "PyExc_FileExistsError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_FileNotFoundError (C var)"
msgstr "PyExc_FileNotFoundError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_FloatingPointError (C var)"
msgstr "PyExc_FloatingPointError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_GeneratorExit (C var)"
msgstr "PyExc_GeneratorExit(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ImportError (C var)"
msgstr "PyExc_ImportError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_IndentationError (C var)"
msgstr "PyExc_IndentationError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_IndexError (C var)"
msgstr "PyExc_IndexError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_InterruptedError (C var)"
msgstr "PyExc_InterruptedError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_IsADirectoryError (C var)"
msgstr "PyExc_IsADirectoryError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_KeyError (C var)"
msgstr "PyExc_KeyError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_KeyboardInterrupt (C var)"
msgstr "PyExc_KeyboardInterrupt(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_LookupError (C var)"
msgstr "PyExc_LookupError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_MemoryError (C var)"
msgstr "PyExc_MemoryError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ModuleNotFoundError (C var)"
msgstr "PyExc_ModuleNotFoundError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_NameError (C var)"
msgstr "PyExc_NameError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_NotADirectoryError (C var)"
msgstr "PyExc_NotADirectoryError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_NotImplementedError (C var)"
msgstr "PyExc_NotImplementedError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_OSError (C var)"
msgstr "PyExc_OSError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_OverflowError (C var)"
msgstr "PyExc_OverflowError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_PermissionError (C var)"
msgstr "PyExc_PermissionError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ProcessLookupError (C var)"
msgstr "PyExc_ProcessLookupError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
+msgid "PyExc_PythonFinalizationError (C var)"
+msgstr "PyExc_PythonFinalizationError(C 變數)"
+
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_RecursionError (C var)"
msgstr "PyExc_RecursionError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ReferenceError (C var)"
msgstr "PyExc_ReferenceError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_RuntimeError (C var)"
msgstr "PyExc_RuntimeError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_StopAsyncIteration (C var)"
msgstr "PyExc_StopAsyncIteration(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_StopIteration (C var)"
msgstr "PyExc_StopIteration(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_SyntaxError (C var)"
msgstr "PyExc_SyntaxError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_SystemError (C var)"
msgstr "PyExc_SystemError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_SystemExit (C var)"
msgstr "PyExc_SystemExit(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_TabError (C var)"
msgstr "PyExc_TabError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_TimeoutError (C var)"
msgstr "PyExc_TimeoutError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_TypeError (C var)"
msgstr "PyExc_TypeError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_UnboundLocalError (C var)"
msgstr "PyExc_UnboundLocalError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_UnicodeDecodeError (C var)"
msgstr "PyExc_UnicodeDecodeError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_UnicodeEncodeError (C var)"
msgstr "PyExc_UnicodeEncodeError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_UnicodeError (C var)"
msgstr "PyExc_UnicodeError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_UnicodeTranslateError (C var)"
msgstr "PyExc_UnicodeTranslateError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ValueError (C var)"
msgstr "PyExc_ValueError(C 變數)"
-#: ../../c-api/exceptions.rst:958
+#: ../../c-api/exceptions.rst:971
msgid "PyExc_ZeroDivisionError (C var)"
msgstr "PyExc_ZeroDivisionError(C 變數)"
-#: ../../c-api/exceptions.rst:1141
+#: ../../c-api/exceptions.rst:1157
msgid "PyExc_EnvironmentError (C var)"
msgstr "PyExc_EnvironmentError(C 變數)"
-#: ../../c-api/exceptions.rst:1141
+#: ../../c-api/exceptions.rst:1157
msgid "PyExc_IOError (C var)"
msgstr "PyExc_IOError(C 變數)"
-#: ../../c-api/exceptions.rst:1141
+#: ../../c-api/exceptions.rst:1157
msgid "PyExc_WindowsError (C var)"
msgstr "PyExc_WindowsError(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_Warning (C var)"
msgstr "PyExc_Warning(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_BytesWarning (C var)"
msgstr "PyExc_BytesWarning(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_DeprecationWarning (C var)"
msgstr "PyExc_DeprecationWarning(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_FutureWarning (C var)"
msgstr "PyExc_FutureWarning(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_ImportWarning (C var)"
msgstr "PyExc_ImportWarning(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_PendingDeprecationWarning (C var)"
msgstr "PyExc_PendingDeprecationWarning(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_ResourceWarning (C var)"
msgstr "PyExc_ResourceWarning(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_RuntimeWarning (C var)"
msgstr "PyExc_RuntimeWarning(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_SyntaxWarning (C var)"
msgstr "PyExc_SyntaxWarning(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_UnicodeWarning (C var)"
msgstr "PyExc_UnicodeWarning(C 變數)"
-#: ../../c-api/exceptions.rst:1178
+#: ../../c-api/exceptions.rst:1194
msgid "PyExc_UserWarning (C var)"
msgstr "PyExc_UserWarning(C 變數)"
diff --git a/c-api/file.po b/c-api/file.po
index 4a1d1c1e24..cb40f45c72 100644
--- a/c-api/file.po
+++ b/c-api/file.po
@@ -7,9 +7,9 @@
# Matt Wang , 2022
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-04 00:03+0000\n"
+"POT-Creation-Date: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2023-04-24 20:38+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -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
@@ -111,10 +111,10 @@ msgstr ""
"數。"
#: ../../c-api/file.rst:68
-msgid "The handler is a function of type:"
+msgid "The *handler* is a function of type:"
msgstr ""
-#: ../../c-api/file.rst:72
+#: ../../c-api/file.rst:73
#, fuzzy
msgid ""
"Equivalent of :c:expr:`PyObject *(\\*)(PyObject *path, void *userData)`, "
@@ -123,7 +123,7 @@ msgstr ""
"處理程式是 :c:expr:`PyObject *(\\*)(PyObject *path, void *userData)` 型別的函"
"式,其中 *path* 保證為 :c:type:`PyUnicodeObject`。"
-#: ../../c-api/file.rst:76
+#: ../../c-api/file.rst:77
msgid ""
"The *userData* pointer is passed into the hook function. Since hook "
"functions may be called from different runtimes, this pointer should not "
@@ -132,7 +132,7 @@ msgstr ""
"*userData* 指標被傳遞到掛鉤函式 (hook function) 中。由於可能會從不同的執行環"
"境 (runtime) 呼叫掛鉤函式,因此該指標不應直接指向 Python 狀態。"
-#: ../../c-api/file.rst:80
+#: ../../c-api/file.rst:81
msgid ""
"As this hook is intentionally used during import, avoid importing new "
"modules during its execution unless they are known to be frozen or available "
@@ -141,7 +141,7 @@ msgstr ""
"由於此掛鉤函式是在導入期間有意使用的,因此請避免在其執行期間導入新模組,除非"
"它們已知有被凍結或在 ``sys.modules`` 中可用。"
-#: ../../c-api/file.rst:84
+#: ../../c-api/file.rst:85
#, fuzzy
msgid ""
"Once a hook has been set, it cannot be removed or replaced, and later calls "
@@ -152,11 +152,11 @@ msgstr ""
"`PyFile_SetOpenCodeHook` 將失敗。失敗時,函式回傳 -1 並在直譯器已初始化時設定"
"例外。"
-#: ../../c-api/file.rst:88
+#: ../../c-api/file.rst:89
msgid "This function is safe to call before :c:func:`Py_Initialize`."
msgstr "在 :c:func:`Py_Initialize` 之前呼叫此函式是安全的。"
-#: ../../c-api/file.rst:90
+#: ../../c-api/file.rst:91
msgid ""
"Raises an :ref:`auditing event ` ``setopencodehook`` with no "
"arguments."
@@ -164,7 +164,7 @@ msgstr ""
"不帶引數地引發一個\\ :ref:`稽核事件 (auditing event) ` "
"``setopencodehook``。"
-#: ../../c-api/file.rst:100
+#: ../../c-api/file.rst:101
msgid ""
"Write object *obj* to file object *p*. The only supported flag for *flags* "
"is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of the object is "
@@ -175,7 +175,7 @@ msgstr ""
"`Py_PRINT_RAW`;如果有給定,則寫入物件的 :func:`str` 而不是 :func:`repr`。在"
"成功回傳 ``0`` 或在失敗回傳 ``-1``;將設定適當的例外。"
-#: ../../c-api/file.rst:108
+#: ../../c-api/file.rst:109
msgid ""
"Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on "
"failure; the appropriate exception will be set."
@@ -195,6 +195,6 @@ msgstr "file(檔案)"
msgid "EOFError (built-in exception)"
msgstr "EOFError(內建例外)"
-#: ../../c-api/file.rst:98
+#: ../../c-api/file.rst:99
msgid "Py_PRINT_RAW (C macro)"
msgstr "Py_PRINT_RAW(C 巨集)"
diff --git a/c-api/float.po b/c-api/float.po
index df086b405b..3c2eff7ff2 100644
--- a/c-api/float.po
+++ b/c-api/float.po
@@ -7,7 +7,7 @@
# Liang-Bo Wang , 2015
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-20 00:03+0000\n"
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
@@ -159,7 +159,7 @@ msgstr ""
#: ../../c-api/float.rst:122
msgid "``-0.0`` and ``+0.0`` produce the same bytes string."
-msgstr ""
+msgstr "``-0.0`` 和 ``+0.0`` 會產生同樣的位元組字串。"
#: ../../c-api/float.rst:126
msgid "Pack a C double as the IEEE 754 binary16 half-precision format."
diff --git a/c-api/frame.po b/c-api/frame.po
index c7c3384f27..da34208fb5 100644
--- a/c-api/frame.po
+++ b/c-api/frame.po
@@ -1,17 +1,16 @@
-# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
-# FIRST AUTHOR , YEAR.
#
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-12-06 00:03+0000\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: LANGUAGE \n"
+"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
+"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -87,7 +86,7 @@ msgstr "回傳 :term:`strong reference`。結果不能為 ``NULL``。"
msgid "Get the *frame* code."
msgstr ""
-#: ../../c-api/frame.rst:64 ../../c-api/frame.rst:125
+#: ../../c-api/frame.rst:64 ../../c-api/frame.rst:130
msgid "Return a :term:`strong reference`."
msgstr "回傳 :term:`strong reference`。"
@@ -146,34 +145,70 @@ msgid ""
msgstr ""
#: ../../c-api/frame.rst:123
-msgid "Get the *frame*'s :attr:`~frame.f_locals` attribute (:class:`dict`)."
+msgid ""
+"Get the *frame*'s :attr:`~frame.f_locals` attribute. If the frame refers to "
+"an :term:`optimized scope`, this returns a write-through proxy object that "
+"allows modifying the locals. In all other cases (classes, modules, :func:"
+"`exec`, :func:`eval`) it returns the mapping representing the frame locals "
+"directly (as described for :func:`locals`)."
+msgstr ""
+
+#: ../../c-api/frame.rst:134
+msgid ""
+"As part of :pep:`667`, return an instance of :c:var:"
+"`PyFrameLocalsProxy_Type`."
msgstr ""
-#: ../../c-api/frame.rst:132
+#: ../../c-api/frame.rst:140
msgid "Return the line number that *frame* is currently executing."
msgstr ""
-#: ../../c-api/frame.rst:137
+#: ../../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:139
+#: ../../c-api/frame.rst:167
msgid "Unless using :pep:`523`, you will not need this."
msgstr ""
-#: ../../c-api/frame.rst:143
+#: ../../c-api/frame.rst:171
msgid "The interpreter's internal frame representation."
msgstr ""
-#: ../../c-api/frame.rst:149
+#: ../../c-api/frame.rst:177
msgid "Return a :term:`strong reference` to the code object for the frame."
msgstr ""
-#: ../../c-api/frame.rst:156
+#: ../../c-api/frame.rst:184
msgid "Return the byte offset into the last executed instruction."
msgstr ""
-#: ../../c-api/frame.rst:163
+#: ../../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 fd946abcb3..299c34cd6c 100644
--- a/c-api/function.po
+++ b/c-api/function.po
@@ -8,9 +8,9 @@
# Matt Wang , 2022
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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 e52f8c9b5d..5fd35ae6f8 100644
--- a/c-api/gcsupport.po
+++ b/c-api/gcsupport.po
@@ -5,9 +5,9 @@
# Translators:
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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/gen.po b/c-api/gen.po
index 400aa9f691..a1d498d11c 100644
--- a/c-api/gen.po
+++ b/c-api/gen.po
@@ -8,7 +8,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-13 00:11+0000\n"
"PO-Revision-Date: 2022-10-16 15:33+0800\n"
diff --git a/c-api/hash.po b/c-api/hash.po
index 543ff1d4b4..01b52c5549 100644
--- a/c-api/hash.po
+++ b/c-api/hash.po
@@ -5,9 +5,9 @@
# Matt Wang , 2024
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-02-18 00:03+0000\n"
+"POT-Creation-Date: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2024-04-30 00:20+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -22,8 +22,9 @@ msgid "PyHash API"
msgstr "PyHash API"
#: ../../c-api/hash.rst:6
-msgid "See also the :c:member:`PyTypeObject.tp_hash` member."
-msgstr "另請參閱 :c:member:`PyTypeObject.tp_hash` 成員。"
+msgid ""
+"See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`."
+msgstr "另請參閱 :c:member:`PyTypeObject.tp_hash` 成員和 :ref:`numeric-hash`。"
#: ../../c-api/hash.rst:10
msgid "Hash value type: signed integer."
@@ -33,28 +34,70 @@ msgstr "雜湊值型別:有符號整數。"
msgid "Hash value type: unsigned integer."
msgstr "雜湊值型別:無符號整數。"
-#: ../../c-api/hash.rst:23
+#: ../../c-api/hash.rst:22
+msgid ""
+"The `Mersenne prime `_ ``P = "
+"2**n -1``, used for numeric hash scheme."
+msgstr ""
+
+#: ../../c-api/hash.rst:28
+msgid "The exponent ``n`` of ``P`` in :c:macro:`PyHASH_MODULUS`."
+msgstr ""
+
+#: ../../c-api/hash.rst:34
+msgid "Prime multiplier used in string and various other hashes."
+msgstr ""
+
+#: ../../c-api/hash.rst:40
+msgid "The hash value returned for a positive infinity."
+msgstr ""
+
+#: ../../c-api/hash.rst:46
+msgid "The multiplier used for the imaginary part of a complex number."
+msgstr ""
+
+#: ../../c-api/hash.rst:52
msgid "Hash function definition used by :c:func:`PyHash_GetFuncDef`."
msgstr ":c:func:`PyHash_GetFuncDef` 所使用的雜湊函式定義。"
-#: ../../c-api/hash.rst:31
+#: ../../c-api/hash.rst:60
msgid "Hash function name (UTF-8 encoded string)."
msgstr "雜湊函式名稱(UTF-8 編碼字串)。"
-#: ../../c-api/hash.rst:35
+#: ../../c-api/hash.rst:64
msgid "Internal size of the hash value in bits."
msgstr "雜湊值的內部大小(以位元為單位)。"
-#: ../../c-api/hash.rst:39
+#: ../../c-api/hash.rst:68
msgid "Size of seed input in bits."
msgstr "Seed 輸入的大小(以位元為單位)。"
-#: ../../c-api/hash.rst:46
+#: ../../c-api/hash.rst:75
msgid "Get the hash function definition."
msgstr "取得雜湊函式定義。"
-#: ../../c-api/hash.rst:49
+#: ../../c-api/hash.rst:78
msgid ":pep:`456` \"Secure and interchangeable hash algorithm\"."
msgstr ""
":pep:`456`\\ 「安全且可交替使用的雜湊演算法 (Secure and interchangeable hash "
"algorithm)」。"
+
+#: ../../c-api/hash.rst:85
+msgid ""
+"Hash a pointer value: process the pointer value as an integer (cast it to "
+"``uintptr_t`` internally). The pointer is not dereferenced."
+msgstr ""
+
+#: ../../c-api/hash.rst:88
+msgid "The function cannot fail: it cannot return ``-1``."
+msgstr ""
+
+#: ../../c-api/hash.rst:94
+msgid ""
+"Generic hashing function that is meant to be put into a type object's "
+"``tp_hash`` slot. Its result only depends on the object's identity."
+msgstr ""
+
+#: ../../c-api/hash.rst:99
+msgid "In CPython, it is equivalent to :c:func:`Py_HashPointer`."
+msgstr ""
diff --git a/c-api/import.po b/c-api/import.po
index 340d9ccd66..8f830d9e96 100644
--- a/c-api/import.po
+++ b/c-api/import.po
@@ -6,9 +6,9 @@
# Ching-Lung Chuang, 2015
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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: 2024-10-10 00:13+0000\n"
"PO-Revision-Date: 2018-05-23 14:06+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -41,13 +41,17 @@ msgid ""
"needed anymore."
msgstr ""
-#: ../../c-api/import.rst:34
+#: ../../c-api/import.rst:29
+msgid "Use :c:func:`PyImport_ImportModule` instead."
+msgstr "請改用 :c:func:`PyImport_ImportModule`。"
+
+#: ../../c-api/import.rst:37
msgid ""
"Import a module. This is best described by referring to the built-in Python "
"function :func:`__import__`."
msgstr ""
-#: ../../c-api/import.rst:37 ../../c-api/import.rst:53
+#: ../../c-api/import.rst:40 ../../c-api/import.rst:56
msgid ""
"The return value is a new reference to the imported module or top-level "
"package, or ``NULL`` with an exception set on failure. Like for :func:"
@@ -55,30 +59,30 @@ msgid ""
"is normally the top-level package, unless a non-empty *fromlist* was given."
msgstr ""
-#: ../../c-api/import.rst:43
+#: ../../c-api/import.rst:46
msgid ""
"Failing imports remove incomplete module objects, like with :c:func:"
"`PyImport_ImportModule`."
msgstr ""
-#: ../../c-api/import.rst:49
+#: ../../c-api/import.rst:52
msgid ""
"Import a module. This is best described by referring to the built-in Python "
"function :func:`__import__`, as the standard :func:`__import__` function "
"calls this function directly."
msgstr ""
-#: ../../c-api/import.rst:63
+#: ../../c-api/import.rst:66
msgid ""
"Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is a "
"UTF-8 encoded string instead of a Unicode object."
msgstr ""
-#: ../../c-api/import.rst:66
+#: ../../c-api/import.rst:69
msgid "Negative values for *level* are no longer accepted."
msgstr ""
-#: ../../c-api/import.rst:71
+#: ../../c-api/import.rst:74
msgid ""
"This is a higher-level interface that calls the current \"import hook "
"function\" (with an explicit *level* of 0, meaning absolute import). It "
@@ -87,40 +91,59 @@ msgid ""
"hooks are installed in the current environment."
msgstr ""
-#: ../../c-api/import.rst:77
+#: ../../c-api/import.rst:80
msgid "This function always uses absolute imports."
msgstr ""
-#: ../../c-api/import.rst:82
+#: ../../c-api/import.rst:85
msgid ""
"Reload a module. Return a new reference to the reloaded module, or ``NULL`` "
"with an exception set on failure (the module still exists in this case)."
msgstr ""
-#: ../../c-api/import.rst:88
+#: ../../c-api/import.rst:91
+msgid "Return the module object corresponding to a module name."
+msgstr ""
+
+#: ../../c-api/import.rst:93
+msgid ""
+"The *name* argument may be of the form ``package.module``. First check the "
+"modules dictionary if there's one there, and if not, create a new one and "
+"insert it in the modules dictionary."
+msgstr ""
+
+#: ../../c-api/import.rst:97
msgid ""
-"Return the module object corresponding to a module name. The *name* "
-"argument may be of the form ``package.module``. First check the modules "
-"dictionary if there's one there, and if not, create a new one and insert it "
-"in the modules dictionary. Return ``NULL`` with an exception set on failure."
+"Return a :term:`strong reference` to the module on success. Return ``NULL`` "
+"with an exception set on failure."
+msgstr ""
+
+#: ../../c-api/import.rst:100
+msgid "The module name *name* is decoded from UTF-8."
msgstr ""
-#: ../../c-api/import.rst:95
+#: ../../c-api/import.rst:102
msgid ""
"This function does not load or import the module; if the module wasn't "
"already loaded, you will get an empty module object. Use :c:func:"
-"`PyImport_ImportModule` or one of its variants to import a module. Package "
+"`PyImport_ImportModule` or one of its variants to import a module. Package "
"structures implied by a dotted name for *name* are not created if not "
"already present."
msgstr ""
-#: ../../c-api/import.rst:105
+#: ../../c-api/import.rst:113
msgid ""
-"Similar to :c:func:`PyImport_AddModuleObject`, but the name is a UTF-8 "
-"encoded string instead of a Unicode object."
+"Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed "
+"reference` and *name* is a Python :class:`str` object."
msgstr ""
-#: ../../c-api/import.rst:113
+#: ../../c-api/import.rst:121
+msgid ""
+"Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed "
+"reference`."
+msgstr ""
+
+#: ../../c-api/import.rst:129
msgid ""
"Given a module name (possibly of the form ``package.module``) and a code "
"object read from a Python bytecode file or obtained from the built-in "
@@ -134,69 +157,69 @@ msgid ""
"to the module author's intents) state."
msgstr ""
-#: ../../c-api/import.rst:123
+#: ../../c-api/import.rst:139
msgid ""
-"The module's :attr:`__spec__` and :attr:`__loader__` will be set, if not set "
-"already, with the appropriate values. The spec's loader will be set to the "
-"module's ``__loader__`` (if set) and to an instance of :class:`~importlib."
-"machinery.SourceFileLoader` otherwise."
+"The module's :attr:`~module.__spec__` and :attr:`~module.__loader__` will be "
+"set, if not set already, with the appropriate values. The spec's loader "
+"will be set to the module's :attr:`!__loader__` (if set) and to an instance "
+"of :class:`~importlib.machinery.SourceFileLoader` otherwise."
msgstr ""
-#: ../../c-api/import.rst:128
+#: ../../c-api/import.rst:144
msgid ""
-"The module's :attr:`__file__` attribute will be set to the code object's :"
-"attr:`~codeobject.co_filename`. If applicable, :attr:`__cached__` will also "
-"be set."
+"The module's :attr:`~module.__file__` attribute will be set to the code "
+"object's :attr:`~codeobject.co_filename`. If applicable, :attr:`~module."
+"__cached__` will also be set."
msgstr ""
-#: ../../c-api/import.rst:132
+#: ../../c-api/import.rst:148
msgid ""
"This function will reload the module if it was already imported. See :c:"
"func:`PyImport_ReloadModule` for the intended way to reload a module."
msgstr ""
-#: ../../c-api/import.rst:135
+#: ../../c-api/import.rst:151
msgid ""
"If *name* points to a dotted name of the form ``package.module``, any "
"package structures not already created will still not be created."
msgstr ""
-#: ../../c-api/import.rst:138
+#: ../../c-api/import.rst:154
msgid ""
"See also :c:func:`PyImport_ExecCodeModuleEx` and :c:func:"
"`PyImport_ExecCodeModuleWithPathnames`."
msgstr ""
-#: ../../c-api/import.rst:141
+#: ../../c-api/import.rst:157
msgid ""
-"The setting of :attr:`__cached__` and :attr:`__loader__` is deprecated. See :"
-"class:`~importlib.machinery.ModuleSpec` for alternatives."
+"The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__` is "
+"deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives."
msgstr ""
-#: ../../c-api/import.rst:149
+#: ../../c-api/import.rst:165
msgid ""
-"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute "
-"of the module object is set to *pathname* if it is non-``NULL``."
+"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`~module.__file__` "
+"attribute of the module object is set to *pathname* if it is non-``NULL``."
msgstr ""
-#: ../../c-api/import.rst:152
+#: ../../c-api/import.rst:168
msgid "See also :c:func:`PyImport_ExecCodeModuleWithPathnames`."
msgstr "也請見 :c:func:`PyImport_ExecCodeModuleWithPathnames`。"
-#: ../../c-api/import.rst:157
+#: ../../c-api/import.rst:173
msgid ""
-"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`__cached__` "
+"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`~module.__cached__` "
"attribute of the module object is set to *cpathname* if it is non-``NULL``. "
"Of the three functions, this is the preferred one to use."
msgstr ""
-#: ../../c-api/import.rst:163
+#: ../../c-api/import.rst:179
msgid ""
-"Setting :attr:`__cached__` is deprecated. See :class:`~importlib.machinery."
-"ModuleSpec` for alternatives."
+"Setting :attr:`~module.__cached__` is deprecated. See :class:`~importlib."
+"machinery.ModuleSpec` for alternatives."
msgstr ""
-#: ../../c-api/import.rst:170
+#: ../../c-api/import.rst:186
msgid ""
"Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and "
"*cpathname* are UTF-8 encoded strings. Attempts are also made to figure out "
@@ -204,48 +227,48 @@ msgid ""
"set to ``NULL``."
msgstr ""
-#: ../../c-api/import.rst:176
+#: ../../c-api/import.rst:192
msgid ""
"Uses :func:`!imp.source_from_cache` in calculating the source path if only "
"the bytecode path is provided."
msgstr ""
-#: ../../c-api/import.rst:179
+#: ../../c-api/import.rst:195
msgid "No longer uses the removed :mod:`!imp` module."
msgstr "不再使用已被移除的 :mod:`!imp` 模組。"
-#: ../../c-api/import.rst:185
+#: ../../c-api/import.rst:201
msgid ""
"Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` "
"file). The magic number should be present in the first four bytes of the "
"bytecode file, in little-endian byte order. Returns ``-1`` on error."
msgstr ""
-#: ../../c-api/import.rst:189
+#: ../../c-api/import.rst:205
msgid "Return value of ``-1`` upon failure."
msgstr "當失敗時回傳 ``-1``。"
-#: ../../c-api/import.rst:195
+#: ../../c-api/import.rst:211
msgid ""
"Return the magic tag string for :pep:`3147` format Python bytecode file "
"names. Keep in mind that the value at ``sys.implementation.cache_tag`` is "
"authoritative and should be used instead of this function."
msgstr ""
-#: ../../c-api/import.rst:203
+#: ../../c-api/import.rst:219
msgid ""
"Return the dictionary used for the module administration (a.k.a. ``sys."
"modules``). Note that this is a per-interpreter variable."
msgstr ""
-#: ../../c-api/import.rst:208
+#: ../../c-api/import.rst:224
msgid ""
"Return the already imported module with the given name. If the module has "
"not been imported yet then returns ``NULL`` but does not set an error. "
"Returns ``NULL`` and sets an error if the lookup failed."
msgstr ""
-#: ../../c-api/import.rst:216
+#: ../../c-api/import.rst:232
msgid ""
"Return a finder object for a :data:`sys.path`/:attr:`!pkg.__path__` item "
"*path*, possibly by fetching it from the :data:`sys.path_importer_cache` "
@@ -256,7 +279,7 @@ msgid ""
"path_importer_cache`. Return a new reference to the finder object."
msgstr ""
-#: ../../c-api/import.rst:227
+#: ../../c-api/import.rst:243
msgid ""
"Load a frozen module named *name*. Return ``1`` for success, ``0`` if the "
"module is not found, and ``-1`` with an exception set if the initialization "
@@ -265,17 +288,17 @@ msgid ""
"the module if it was already imported.)"
msgstr ""
-#: ../../c-api/import.rst:235
+#: ../../c-api/import.rst:251
msgid "The ``__file__`` attribute is no longer set on the module."
msgstr ""
-#: ../../c-api/import.rst:241
+#: ../../c-api/import.rst:257
msgid ""
"Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a "
"UTF-8 encoded string instead of a Unicode object."
msgstr ""
-#: ../../c-api/import.rst:249
+#: ../../c-api/import.rst:265
msgid ""
"This is the structure type definition for frozen module descriptors, as "
"generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the "
@@ -283,7 +306,7 @@ msgid ""
"h`, is::"
msgstr ""
-#: ../../c-api/import.rst:254
+#: ../../c-api/import.rst:270
msgid ""
"struct _frozen {\n"
" const char *name;\n"
@@ -299,13 +322,13 @@ msgstr ""
" bool is_package;\n"
"};"
-#: ../../c-api/import.rst:261
+#: ../../c-api/import.rst:277
msgid ""
"The new ``is_package`` field indicates whether the module is a package or "
"not. This replaces setting the ``size`` field to a negative value."
msgstr ""
-#: ../../c-api/import.rst:267
+#: ../../c-api/import.rst:283
msgid ""
"This pointer is initialized to point to an array of :c:struct:`_frozen` "
"records, terminated by one whose members are all ``NULL`` or zero. When a "
@@ -314,7 +337,7 @@ msgid ""
"frozen modules."
msgstr ""
-#: ../../c-api/import.rst:275
+#: ../../c-api/import.rst:291
msgid ""
"Add a single module to the existing table of built-in modules. This is a "
"convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning "
@@ -324,7 +347,7 @@ msgid ""
"before :c:func:`Py_Initialize`."
msgstr ""
-#: ../../c-api/import.rst:285
+#: ../../c-api/import.rst:301
msgid ""
"Structure describing a single entry in the list of built-in modules. "
"Programs which embed Python may use an array of these structures in "
@@ -332,15 +355,15 @@ msgid ""
"built-in modules. The structure consists of two members:"
msgstr ""
-#: ../../c-api/import.rst:293
+#: ../../c-api/import.rst:309
msgid "The module name, as an ASCII encoded string."
msgstr ""
-#: ../../c-api/import.rst:297
+#: ../../c-api/import.rst:313
msgid "Initialization function for a module built into the interpreter."
msgstr ""
-#: ../../c-api/import.rst:302
+#: ../../c-api/import.rst:318
msgid ""
"Add a collection of modules to the table of built-in modules. The *newtab* "
"array must end with a sentinel entry which contains ``NULL`` for the :c:"
@@ -351,7 +374,7 @@ msgid ""
"before :c:func:`Py_Initialize`."
msgstr ""
-#: ../../c-api/import.rst:309
+#: ../../c-api/import.rst:325
msgid ""
"If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` "
"or :c:func:`PyImport_ExtendInittab` must be called before each Python "
@@ -374,18 +397,18 @@ msgstr "__all__(套件變數)"
msgid "modules (in module sys)"
msgstr "modules(sys 模組中)"
-#: ../../c-api/import.rst:32 ../../c-api/import.rst:111
+#: ../../c-api/import.rst:35 ../../c-api/import.rst:127
msgid "built-in function"
msgstr "built-in function(內建函式)"
-#: ../../c-api/import.rst:32
+#: ../../c-api/import.rst:35
msgid "__import__"
msgstr "__import__"
-#: ../../c-api/import.rst:111
+#: ../../c-api/import.rst:127
msgid "compile"
msgstr "compile(編譯)"
-#: ../../c-api/import.rst:247
+#: ../../c-api/import.rst:263
msgid "freeze utility"
msgstr "freeze utility(凍結工具)"
diff --git a/c-api/index.po b/c-api/index.po
index d1aa91e806..7e0a7df309 100644
--- a/c-api/index.po
+++ b/c-api/index.po
@@ -8,7 +8,7 @@
# Steven Hsu , 2021
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-26 18:54+0800\n"
"PO-Revision-Date: 2021-07-05 21:11+0800\n"
diff --git a/c-api/init.po b/c-api/init.po
index 8f5da7b89d..0ce89e728e 100644
--- a/c-api/init.po
+++ b/c-api/init.po
@@ -1,4 +1,3 @@
-# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
@@ -6,9 +5,9 @@
# Adrian Liaw , 2018
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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-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-"
@@ -25,14 +24,18 @@ msgid "Initialization, Finalization, and Threads"
msgstr ""
#: ../../c-api/init.rst:10
-msgid "See also :ref:`Python Initialization Configuration `."
-msgstr "也請參見 :ref:`Python 初始化設定 `。"
+msgid ""
+"See :ref:`Python Initialization Configuration ` for details on "
+"how to configure the interpreter prior to initialization."
+msgstr ""
+"關於如何在初始化之前設定直譯器的細節,請參見 :ref:`Python 初始化設定 `。"
-#: ../../c-api/init.rst:15
+#: ../../c-api/init.rst:16
msgid "Before Python Initialization"
msgstr "Python 初始化之前"
-#: ../../c-api/init.rst:17
+#: ../../c-api/init.rst:18
msgid ""
"In an application embedding Python, the :c:func:`Py_Initialize` function "
"must be called before using any other Python/C API functions; with the "
@@ -40,335 +43,368 @@ msgid ""
"`."
msgstr ""
-#: ../../c-api/init.rst:22
+#: ../../c-api/init.rst:23
msgid ""
"The following functions can be safely called before Python is initialized:"
msgstr ""
-#: ../../c-api/init.rst:24
+#: ../../c-api/init.rst:25
+msgid "Functions that initialize the interpreter:"
+msgstr ""
+
+#: ../../c-api/init.rst:27
+msgid ":c:func:`Py_Initialize`"
+msgstr ":c:func:`Py_Initialize`"
+
+#: ../../c-api/init.rst:28
+msgid ":c:func:`Py_InitializeEx`"
+msgstr ":c:func:`Py_InitializeEx`"
+
+#: ../../c-api/init.rst:29
+msgid ":c:func:`Py_InitializeFromConfig`"
+msgstr ":c:func:`Py_InitializeFromConfig`"
+
+#: ../../c-api/init.rst:30
+msgid ":c:func:`Py_BytesMain`"
+msgstr ":c:func:`Py_BytesMain`"
+
+#: ../../c-api/init.rst:31
+msgid ":c:func:`Py_Main`"
+msgstr ":c:func:`Py_Main`"
+
+#: ../../c-api/init.rst:32
+msgid "the runtime pre-initialization functions covered in :ref:`init-config`"
+msgstr ""
+
+#: ../../c-api/init.rst:34
msgid "Configuration functions:"
msgstr ""
-#: ../../c-api/init.rst:26
+#: ../../c-api/init.rst:36
msgid ":c:func:`PyImport_AppendInittab`"
msgstr ":c:func:`PyImport_AppendInittab`"
-#: ../../c-api/init.rst:27
+#: ../../c-api/init.rst:37
msgid ":c:func:`PyImport_ExtendInittab`"
msgstr ":c:func:`PyImport_ExtendInittab`"
-#: ../../c-api/init.rst:28
+#: ../../c-api/init.rst:38
msgid ":c:func:`!PyInitFrozenExtensions`"
msgstr ":c:func:`!PyInitFrozenExtensions`"
-#: ../../c-api/init.rst:29
+#: ../../c-api/init.rst:39
msgid ":c:func:`PyMem_SetAllocator`"
msgstr ":c:func:`PyMem_SetAllocator`"
-#: ../../c-api/init.rst:30
+#: ../../c-api/init.rst:40
msgid ":c:func:`PyMem_SetupDebugHooks`"
msgstr ":c:func:`PyMem_SetupDebugHooks`"
-#: ../../c-api/init.rst:31
+#: ../../c-api/init.rst:41
msgid ":c:func:`PyObject_SetArenaAllocator`"
msgstr ":c:func:`PyObject_SetArenaAllocator`"
-#: ../../c-api/init.rst:32
-msgid ":c:func:`Py_SetPath`"
-msgstr ":c:func:`Py_SetPath`"
-
-#: ../../c-api/init.rst:33
+#: ../../c-api/init.rst:42
msgid ":c:func:`Py_SetProgramName`"
msgstr ":c:func:`Py_SetProgramName`"
-#: ../../c-api/init.rst:34
+#: ../../c-api/init.rst:43
msgid ":c:func:`Py_SetPythonHome`"
msgstr ":c:func:`Py_SetPythonHome`"
-#: ../../c-api/init.rst:35
-msgid ":c:func:`Py_SetStandardStreamEncoding`"
-msgstr ":c:func:`Py_SetStandardStreamEncoding`"
-
-#: ../../c-api/init.rst:36
-msgid ":c:func:`PySys_AddWarnOption`"
-msgstr ":c:func:`PySys_AddWarnOption`"
-
-#: ../../c-api/init.rst:37
-msgid ":c:func:`PySys_AddXOption`"
-msgstr ":c:func:`PySys_AddXOption`"
-
-#: ../../c-api/init.rst:38
+#: ../../c-api/init.rst:44
msgid ":c:func:`PySys_ResetWarnOptions`"
msgstr ":c:func:`PySys_ResetWarnOptions`"
-#: ../../c-api/init.rst:40
+#: ../../c-api/init.rst:45
+msgid "the configuration functions covered in :ref:`init-config`"
+msgstr ""
+
+#: ../../c-api/init.rst:47
msgid "Informative functions:"
msgstr ""
-#: ../../c-api/init.rst:42
+#: ../../c-api/init.rst:49 ../../c-api/init.rst:57
msgid ":c:func:`Py_IsInitialized`"
msgstr ":c:func:`Py_IsInitialized`"
-#: ../../c-api/init.rst:43
+#: ../../c-api/init.rst:50
msgid ":c:func:`PyMem_GetAllocator`"
msgstr ":c:func:`PyMem_GetAllocator`"
-#: ../../c-api/init.rst:44
+#: ../../c-api/init.rst:51
msgid ":c:func:`PyObject_GetArenaAllocator`"
msgstr ":c:func:`PyObject_GetArenaAllocator`"
-#: ../../c-api/init.rst:45
+#: ../../c-api/init.rst:52
msgid ":c:func:`Py_GetBuildInfo`"
msgstr ":c:func:`Py_GetBuildInfo`"
-#: ../../c-api/init.rst:46
+#: ../../c-api/init.rst:53
msgid ":c:func:`Py_GetCompiler`"
msgstr ":c:func:`Py_GetCompiler`"
-#: ../../c-api/init.rst:47
+#: ../../c-api/init.rst:54
msgid ":c:func:`Py_GetCopyright`"
msgstr ":c:func:`Py_GetCopyright`"
-#: ../../c-api/init.rst:48
+#: ../../c-api/init.rst:55
msgid ":c:func:`Py_GetPlatform`"
msgstr ":c:func:`Py_GetPlatform`"
-#: ../../c-api/init.rst:49
+#: ../../c-api/init.rst:56
msgid ":c:func:`Py_GetVersion`"
msgstr ":c:func:`Py_GetVersion`"
-#: ../../c-api/init.rst:51
+#: ../../c-api/init.rst:59
msgid "Utilities:"
msgstr ""
-#: ../../c-api/init.rst:53
+#: ../../c-api/init.rst:61
msgid ":c:func:`Py_DecodeLocale`"
msgstr ":c:func:`Py_DecodeLocale`"
-#: ../../c-api/init.rst:55
+#: ../../c-api/init.rst:62
+msgid ""
+"the status reporting and utility functions covered in :ref:`init-config`"
+msgstr ""
+
+#: ../../c-api/init.rst:64
msgid "Memory allocators:"
msgstr ""
-#: ../../c-api/init.rst:57
+#: ../../c-api/init.rst:66
msgid ":c:func:`PyMem_RawMalloc`"
msgstr ":c:func:`PyMem_RawMalloc`"
-#: ../../c-api/init.rst:58
+#: ../../c-api/init.rst:67
msgid ":c:func:`PyMem_RawRealloc`"
msgstr ":c:func:`PyMem_RawRealloc`"
-#: ../../c-api/init.rst:59
+#: ../../c-api/init.rst:68
msgid ":c:func:`PyMem_RawCalloc`"
msgstr ":c:func:`PyMem_RawCalloc`"
-#: ../../c-api/init.rst:60
+#: ../../c-api/init.rst:69
msgid ":c:func:`PyMem_RawFree`"
msgstr ":c:func:`PyMem_RawFree`"
-#: ../../c-api/init.rst:64
-msgid ""
-"The following functions **should not be called** before :c:func:"
-"`Py_Initialize`: :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` and :c:func:`PyEval_InitThreads`."
+#: ../../c-api/init.rst:71
+msgid "Synchronization:"
msgstr ""
+#: ../../c-api/init.rst:73
+msgid ":c:func:`PyMutex_Lock`"
+msgstr ":c:func:`PyMutex_Lock`"
+
#: ../../c-api/init.rst:74
+msgid ":c:func:`PyMutex_Unlock`"
+msgstr ":c:func:`PyMutex_Unlock`"
+
+#: ../../c-api/init.rst:78
+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`."
+msgstr ""
+
+#: ../../c-api/init.rst:90
msgid "Global configuration variables"
msgstr ""
-#: ../../c-api/init.rst:76
+#: ../../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:80
+#: ../../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:86
+#: ../../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:90
+#: ../../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:94
+#: ../../c-api/init.rst:110
msgid "Set by the :option:`-b` option."
msgstr "由 :option:`-b` 選項設定。"
-#: ../../c-api/init.rst:100
+#: ../../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:104
+#: ../../c-api/init.rst:120
msgid ""
"Turn on parser debugging output (for expert only, depending on compilation "
"options)."
msgstr ""
-#: ../../c-api/init.rst:107
+#: ../../c-api/init.rst:123
msgid ""
"Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment "
"variable."
msgstr "由 :option:`-d` 選項與 :envvar:`PYTHONDEBUG` 環境變數設定。"
-#: ../../c-api/init.rst:114
+#: ../../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:118
+#: ../../c-api/init.rst:134
msgid ""
"If set to non-zero, Python won't try to write ``.pyc`` files on the import "
"of source modules."
msgstr ""
-#: ../../c-api/init.rst:121
+#: ../../c-api/init.rst:137
msgid ""
"Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` "
"environment variable."
msgstr ""
"由 :option:`-B` 選項與 :envvar:`PYTHONDONTWRITEBYTECODE` 環境變數設定。"
-#: ../../c-api/init.rst:128
+#: ../../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:132
+#: ../../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:135
+#: ../../c-api/init.rst:151
msgid "Private flag used by ``_freeze_module`` and ``frozenmain`` programs."
msgstr ""
-#: ../../c-api/init.rst:141
+#: ../../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 ""
-#: ../../c-api/init.rst:146
+#: ../../c-api/init.rst:162
msgid ""
"Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to "
"a non-empty string."
msgstr ""
"如果環境變數 :envvar:`PYTHONHASHSEED` 被設定為一個非空字串則設為 ``1``。"
-#: ../../c-api/init.rst:149
+#: ../../c-api/init.rst:165
msgid ""
"If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment "
"variable to initialize the secret hash seed."
msgstr ""
-#: ../../c-api/init.rst:156
+#: ../../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:160
+#: ../../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`。"
-#: ../../c-api/init.rst:163
+#: ../../c-api/init.rst:179
msgid "Set by the :option:`-E` and :option:`-I` options."
msgstr "由 :option:`-E` 與 :option:`-I` 選項設定。"
-#: ../../c-api/init.rst:169
+#: ../../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:173
+#: ../../c-api/init.rst:189
msgid ""
"When a script is passed as first argument or the :option:`-c` option is "
"used, enter interactive mode after executing the script or the command, even "
"when :data:`sys.stdin` does not appear to be a terminal."
msgstr ""
-#: ../../c-api/init.rst:177
+#: ../../c-api/init.rst:193
msgid ""
"Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment "
"variable."
msgstr "由 :option:`-i` 選項與 :envvar:`PYTHONINSPECT` 環境變數設定。"
-#: ../../c-api/init.rst:184
+#: ../../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:188
+#: ../../c-api/init.rst:204
msgid "Set by the :option:`-i` option."
msgstr "由 :option:`-i` 選項設定。"
-#: ../../c-api/init.rst:194
+#: ../../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:198
+#: ../../c-api/init.rst:214
msgid ""
"Run Python in isolated mode. In isolated mode :data:`sys.path` contains "
"neither the script's directory nor the user's site-packages directory."
msgstr ""
-#: ../../c-api/init.rst:201
+#: ../../c-api/init.rst:217
msgid "Set by the :option:`-I` option."
msgstr "由 :option:`-i` 選項設定。"
-#: ../../c-api/init.rst:209
+#: ../../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:213
+#: ../../c-api/init.rst:229
msgid ""
"If the flag is non-zero, use the ``mbcs`` encoding with ``replace`` error "
"handler, instead of the UTF-8 encoding with ``surrogatepass`` error handler, "
"for the :term:`filesystem encoding and error handler`."
msgstr ""
-#: ../../c-api/init.rst:217
+#: ../../c-api/init.rst:233
msgid ""
"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment "
"variable is set to a non-empty string."
@@ -376,131 +412,131 @@ msgstr ""
"如果環境變數 :envvar:`PYTHONLEGACYWINDOWSFSENCODING` 被設定為一個非空字串則設"
"為 ``1``。"
-#: ../../c-api/init.rst:220
+#: ../../c-api/init.rst:236
msgid "See :pep:`529` for more details."
msgstr "更多詳情請見 :pep:`529`。"
-#: ../../c-api/init.rst:222 ../../c-api/init.rst:240
-msgid ":ref:`Availability `: Windows."
-msgstr ":ref:`適用 `:Windows。"
+#: ../../c-api/init.rst:238 ../../c-api/init.rst:256
+msgid "Availability"
+msgstr ""
-#: ../../c-api/init.rst:228
+#: ../../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:232
+#: ../../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:235
+#: ../../c-api/init.rst:251
msgid ""
"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable "
"is set to a non-empty string."
msgstr ""
-#: ../../c-api/init.rst:238
+#: ../../c-api/init.rst:254
msgid "See :pep:`528` for more details."
msgstr "更多詳情請見 :pep:`528`。"
-#: ../../c-api/init.rst:246
+#: ../../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:250
+#: ../../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:255
+#: ../../c-api/init.rst:271
msgid "Set by the :option:`-S` option."
msgstr "由 :option:`-S` 選項設定。"
-#: ../../c-api/init.rst:261
+#: ../../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:265
+#: ../../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:268
+#: ../../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:275
+#: ../../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:279
+#: ../../c-api/init.rst:295
msgid ""
"Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment "
"variable."
msgstr "由 :option:`-O` 選項與 :envvar:`PYTHONOPTIMIZE` 環境變數設定。"
-#: ../../c-api/init.rst:286
+#: ../../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:290
+#: ../../c-api/init.rst:306
msgid ""
"Don't display the copyright and version messages even in interactive mode."
msgstr ""
-#: ../../c-api/init.rst:292
+#: ../../c-api/init.rst:308
msgid "Set by the :option:`-q` option."
msgstr "由 :option:`-q` 選項設定。"
-#: ../../c-api/init.rst:300
+#: ../../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:304
+#: ../../c-api/init.rst:320
msgid "Force the stdout and stderr streams to be unbuffered."
msgstr ""
-#: ../../c-api/init.rst:306
+#: ../../c-api/init.rst:322
msgid ""
"Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` "
"environment variable."
msgstr "由 :option:`-u` 選項與 :envvar:`PYTHONUNBUFFERED` 環境變數設定。"
-#: ../../c-api/init.rst:313
+#: ../../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:317
+#: ../../c-api/init.rst:333
msgid ""
"Print a message each time a module is initialized, showing the place "
"(filename or built-in module) from which it is loaded. If greater or equal "
@@ -508,84 +544,107 @@ msgid ""
"for a module. Also provides information on module cleanup at exit."
msgstr ""
-#: ../../c-api/init.rst:322
+#: ../../c-api/init.rst:338
msgid ""
"Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment "
"variable."
msgstr "由 :option:`-v` 選項與 :envvar:`PYTHONVERBOSE` 環境變數設定。"
-#: ../../c-api/init.rst:329
+#: ../../c-api/init.rst:345
msgid "Initializing and finalizing the interpreter"
msgstr ""
-#: ../../c-api/init.rst:347
+#: ../../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:351
+#: ../../c-api/init.rst:364
msgid ""
"This initializes the table of loaded modules (``sys.modules``), and creates "
-"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It "
+"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It "
"also initializes the module search path (``sys.path``). It does not set "
-"``sys.argv``; use :c:func:`PySys_SetArgvEx` for that. This is a no-op when "
-"called for a second time (without calling :c:func:`Py_FinalizeEx` first). "
-"There is no return value; it is a fatal error if the initialization fails."
+"``sys.argv``; use the :ref:`Python Initialization Configuration ` API for that. This is a no-op when called for a second time "
+"(without calling :c:func:`Py_FinalizeEx` first). There is no return value; "
+"it is a fatal error if the initialization fails."
msgstr ""
-#: ../../c-api/init.rst:359 ../../c-api/init.rst:373
+#: ../../c-api/init.rst:372 ../../c-api/init.rst:386
msgid ""
-"Use the :c:func:`Py_InitializeFromConfig` function to customize the :ref:"
-"`Python Initialization Configuration `."
+"Use :c:func:`Py_InitializeFromConfig` to customize the :ref:`Python "
+"Initialization Configuration `."
msgstr ""
-#: ../../c-api/init.rst:363
+#: ../../c-api/init.rst:376
msgid ""
"On Windows, changes the console mode from ``O_TEXT`` to ``O_BINARY``, which "
"will also affect non-Python uses of the console using the C Runtime."
msgstr ""
-#: ../../c-api/init.rst:369
+#: ../../c-api/init.rst:382
msgid ""
"This function works like :c:func:`Py_Initialize` if *initsigs* is ``1``. If "
"*initsigs* is ``0``, it skips initialization registration of signal "
-"handlers, which might be useful when Python is embedded."
+"handlers, which may be useful when CPython is embedded as part of a larger "
+"application."
+msgstr ""
+
+#: ../../c-api/init.rst:392
+msgid ""
+"Initialize Python from *config* configuration, as described in :ref:`init-"
+"from-config`."
msgstr ""
-#: ../../c-api/init.rst:379
+#: ../../c-api/init.rst:395
+msgid ""
+"See the :ref:`init-config` section for details on pre-initializing the "
+"interpreter, populating the runtime configuration structure, and querying "
+"the returned status structure."
+msgstr ""
+
+#: ../../c-api/init.rst:402
msgid ""
"Return true (nonzero) when the Python interpreter has been initialized, "
"false (zero) if not. After :c:func:`Py_FinalizeEx` is called, this returns "
"false until :c:func:`Py_Initialize` is called again."
msgstr ""
-#: ../../c-api/init.rst:386
+#: ../../c-api/init.rst:409
+msgid ""
+"Return true (non-zero) if the main Python interpreter is :term:`shutting "
+"down `. Return false (zero) otherwise."
+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:393
+#: ../../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:398
+#: ../../c-api/init.rst:429
msgid ""
"Normally the return value is ``0``. If there were errors during finalization "
"(flushing buffered data), ``-1`` is returned."
msgstr ""
-#: ../../c-api/init.rst:402
+#: ../../c-api/init.rst:433
msgid ""
"This function is provided for a number of reasons. An embedding application "
"might want to restart Python without having to restart the application "
@@ -596,7 +655,7 @@ msgid ""
"Python before exiting from the application."
msgstr ""
-#: ../../c-api/init.rst:410
+#: ../../c-api/init.rst:441
msgid ""
"**Bugs and caveats:** The destruction of modules and objects in modules is "
"done in random order; this may cause destructors (:meth:`~object.__del__` "
@@ -611,76 +670,173 @@ msgid ""
"more than once."
msgstr ""
-#: ../../c-api/init.rst:421
+#: ../../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:427
+#: ../../c-api/init.rst:459
msgid ""
"This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that "
"disregards the return value."
msgstr ""
-#: ../../c-api/init.rst:432
-msgid "Process-wide parameters"
+#: ../../c-api/init.rst:465
+msgid ""
+"Similar to :c:func:`Py_Main` but *argv* is an array of bytes strings, "
+"allowing the calling application to delegate the text decoding step to the "
+"CPython runtime."
msgstr ""
-#: ../../c-api/init.rst:442
+#: ../../c-api/init.rst:474
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"stdio_encoding` and :c:member:`PyConfig.stdio_errors` should be used "
-"instead, see :ref:`Python Initialization Configuration `."
+"The main program for the standard interpreter, encapsulating a full "
+"initialization/finalization cycle, as well as additional behaviour to "
+"implement reading configurations settings from the environment and command "
+"line, and then executing ``__main__`` in accordance with :ref:`using-on-"
+"cmdline`."
+msgstr ""
+
+#: ../../c-api/init.rst:480
+msgid ""
+"This is made available for programs which wish to support the full CPython "
+"command line interface, rather than just embedding a Python runtime in a "
+"larger application."
+msgstr ""
+
+#: ../../c-api/init.rst:484
+msgid ""
+"The *argc* and *argv* parameters are similar to those which are passed to a "
+"C program's :c:func:`main` function, except that the *argv* entries are "
+"first converted to ``wchar_t`` using :c:func:`Py_DecodeLocale`. It is also "
+"important to note that the argument list entries may be modified to point to "
+"strings other than those passed in (however, the contents of the strings "
+"pointed to by the argument list are not modified)."
+msgstr ""
+
+#: ../../c-api/init.rst:491
+msgid ""
+"The return value will be ``0`` if the interpreter exits normally (i.e., "
+"without an exception), ``1`` if the interpreter exits due to an exception, "
+"or ``2`` if the argument list does not represent a valid Python command line."
+msgstr ""
+
+#: ../../c-api/init.rst:496
+msgid ""
+"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this "
+"function will not return ``1``, but exit the process, as long as "
+"``Py_InspectFlag`` is not set. If ``Py_InspectFlag`` is set, execution will "
+"drop into the interactive Python prompt, at which point a second otherwise "
+"unhandled :exc:`SystemExit` will still exit the process, while any other "
+"means of exiting will set the return value as described above."
+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::"
msgstr ""
-#: ../../c-api/init.rst:447
+#: ../../c-api/init.rst:507
msgid ""
-"This function should be called before :c:func:`Py_Initialize`, if it is "
-"called at all. It specifies which encoding and error handling to use with "
-"standard IO, with the same meanings as in :func:`str.encode`."
+"PyConfig config;\n"
+"PyConfig_InitPythonConfig(&config);\n"
+"PyConfig_SetArgv(&config, argc, argv);\n"
+"Py_InitializeFromConfig(&config);\n"
+"PyConfig_Clear(&config);\n"
+"\n"
+"Py_RunMain();"
msgstr ""
-#: ../../c-api/init.rst:451
+#: ../../c-api/init.rst:515
msgid ""
-"It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code to "
-"control IO encoding when the environment variable does not work."
+"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)."
msgstr ""
-#: ../../c-api/init.rst:454
+#: ../../c-api/init.rst:528
+msgid "Executes the main module in a fully configured CPython runtime."
+msgstr ""
+
+#: ../../c-api/init.rst:530
msgid ""
-"*encoding* and/or *errors* may be ``NULL`` to use :envvar:`PYTHONIOENCODING` "
-"and/or default values (depending on other settings)."
+"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:458
+#: ../../c-api/init.rst:536
msgid ""
-"Note that :data:`sys.stderr` always uses the \"backslashreplace\" error "
-"handler, regardless of this (or any other) setting."
+"If :c:member:`PyConfig.inspect` is not set (the default), the return value "
+"will be ``0`` if the interpreter exits normally (that is, without raising an "
+"exception), or ``1`` if the interpreter exits due to an exception. If an "
+"otherwise unhandled :exc:`SystemExit` is raised, the function will "
+"immediately exit the process instead of returning ``1``."
msgstr ""
-#: ../../c-api/init.rst:461
+#: ../../c-api/init.rst:542
msgid ""
-"If :c:func:`Py_FinalizeEx` is called, this function will need to be called "
-"again in order to affect subsequent calls to :c:func:`Py_Initialize`."
+"If :c:member:`PyConfig.inspect` is set (such as when the :option:`-i` option "
+"is used), rather than returning when the interpreter exits, execution will "
+"instead resume in an interactive Python prompt (REPL) using the ``__main__`` "
+"module's global namespace. If the interpreter exited with an exception, it "
+"is immediately raised in the REPL session. The function return value is then "
+"determined by the way the *REPL session* terminates: returning ``0`` if the "
+"session terminates without raising an unhandled exception, exiting "
+"immediately for an unhandled :exc:`SystemExit`, and returning ``1`` for any "
+"other unhandled exception."
msgstr ""
-#: ../../c-api/init.rst:464
+#: ../../c-api/init.rst:552
msgid ""
-"Returns ``0`` if successful, a nonzero value on error (e.g. calling after "
-"the interpreter has already been initialized)."
+"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."
msgstr ""
-#: ../../c-api/init.rst:479
+#: ../../c-api/init.rst:556
msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"program_name` should be used instead, see :ref:`Python Initialization "
-"Configuration `."
+"See :ref:`Python Configuration ` for an example of a "
+"customized Python that always runs in isolated mode "
+"using :c:func:`Py_RunMain`."
msgstr ""
-#: ../../c-api/init.rst:483
+#: ../../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:581
+msgid ""
+"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: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 "
@@ -694,60 +850,71 @@ msgid ""
"this storage."
msgstr ""
-#: ../../c-api/init.rst:494
+#: ../../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_t *` string."
+"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get "
+"a :c:expr:`wchar_t*` string."
msgstr ""
-#: ../../c-api/init.rst:504
+#: ../../c-api/init.rst:604
msgid ""
-"Return the program name set with :c:func:`Py_SetProgramName`, or the "
+"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:508 ../../c-api/init.rst:527 ../../c-api/init.rst:568
-#: ../../c-api/init.rst:587 ../../c-api/init.rst:611 ../../c-api/init.rst:834
+#: ../../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:511 ../../c-api/init.rst:530 ../../c-api/init.rst:571
-#: ../../c-api/init.rst:590 ../../c-api/init.rst:616 ../../c-api/init.rst:837
+#: ../../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:517
+#: ../../c-api/init.rst:614 ../../c-api/init.rst:704
+msgid "Get :data:`sys.executable` instead."
+msgstr ""
+
+#: ../../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 "
-"with :c:func:`Py_SetProgramName` and some environment variables; for "
+"with :c:member:`PyConfig.program_name` and some environment variables; for "
"example, if the program name is ``'/usr/local/bin/python'``, the prefix is "
"``'/usr/local'``. The returned string points into static storage; the caller "
"should not modify its value. This corresponds to the :makevar:`prefix` "
"variable in the top-level :file:`Makefile` and the :option:`--prefix` "
"argument to the :program:`configure` script at build time. The value is "
-"available to Python code as ``sys.prefix``. It is only useful on Unix. See "
-"also the next function."
+"available to Python code as ``sys.base_prefix``. It is only useful on Unix. "
+"See also the next function."
msgstr ""
-#: ../../c-api/init.rst:536
+#: ../../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: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:func:`Py_SetProgramName` and some environment variables; for "
+"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.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:546
+#: ../../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 "
@@ -756,7 +923,7 @@ msgid ""
"independent may be installed in :file:`/usr/local`."
msgstr ""
-#: ../../c-api/init.rst:552
+#: ../../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 "
@@ -770,27 +937,33 @@ msgid ""
"independent from the Python version by which they were compiled!)."
msgstr ""
-#: ../../c-api/init.rst:563
+#: ../../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:581
+#: ../../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."
+msgstr ""
+
+#: ../../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 "
-"name (set by :c:func:`Py_SetProgramName` above). The returned string points "
+"name (set by :c:member:`PyConfig.program_name`). The returned string points "
"into static storage; the caller should not modify its value. The value is "
"available to Python code as ``sys.executable``."
msgstr ""
-#: ../../c-api/init.rst:601
+#: ../../c-api/init.rst:714
msgid ""
"Return the default module search path; this is computed from the program "
-"name (set by :c:func:`Py_SetProgramName` above) and some environment "
+"name (set by :c:member:`PyConfig.program_name`) and some environment "
"variables. The returned string consists of a series of directory names "
"separated by a platform dependent delimiter character. The delimiter "
"character is ``':'`` on Unix and macOS, ``';'`` on Windows. The returned "
@@ -800,76 +973,34 @@ msgid ""
"for loading modules."
msgstr ""
-#: ../../c-api/init.rst:627
-msgid ""
-"This API is kept for backward compatibility: setting :c:member:`PyConfig."
-"module_search_paths` and :c:member:`PyConfig.module_search_paths_set` should "
-"be used instead, see :ref:`Python Initialization Configuration `."
-msgstr ""
-
-#: ../../c-api/init.rst:632
-msgid ""
-"Set the default module search path. If this function is called before :c:"
-"func:`Py_Initialize`, then :c:func:`Py_GetPath` won't attempt to compute a "
-"default search path but uses the one provided instead. This is useful if "
-"Python is embedded by an application that has full knowledge of the location "
-"of all modules. The path components should be separated by the platform "
-"dependent delimiter character, which is ``':'`` on Unix and macOS, ``';'`` "
-"on Windows."
-msgstr ""
-
-#: ../../c-api/init.rst:640
-msgid ""
-"This also causes :data:`sys.executable` to be set to the program full path "
-"(see :c:func:`Py_GetProgramFullPath`) and for :data:`sys.prefix` and :data:"
-"`sys.exec_prefix` to be empty. It is up to the caller to modify these if "
-"required after calling :c:func:`Py_Initialize`."
-msgstr ""
-
-#: ../../c-api/init.rst:645 ../../c-api/init.rst:760 ../../c-api/init.rst:796
-#: ../../c-api/init.rst:822
-msgid ""
-"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:"
-"`wchar_*` string."
-msgstr ""
-
-#: ../../c-api/init.rst:648
-msgid ""
-"The path argument is copied internally, so the caller may free it after the "
-"call completes."
-msgstr ""
-
-#: ../../c-api/init.rst:651
-msgid ""
-"The program full path is now used for :data:`sys.executable`, instead of the "
-"program name."
+#: ../../c-api/init.rst:732
+msgid "Get :data:`sys.path` instead."
msgstr ""
-#: ../../c-api/init.rst:660
+#: ../../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:663
+#: ../../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:667
+#: ../../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:672
+#: ../../c-api/init.rst:750
msgid "See also the :c:var:`Py_Version` constant."
msgstr ""
-#: ../../c-api/init.rst:679
+#: ../../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 "
@@ -880,58 +1011,58 @@ msgid ""
"available to Python code as ``sys.platform``."
msgstr ""
-#: ../../c-api/init.rst:690
+#: ../../c-api/init.rst:768
msgid ""
"Return the official copyright string for the current Python version, for "
"example"
msgstr ""
-#: ../../c-api/init.rst:692
+#: ../../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:696
+#: ../../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:702
+#: ../../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:705
+#: ../../c-api/init.rst:783
msgid "\"[GCC 2.7.2.2]\""
msgstr "\"[GCC 2.7.2.2]\""
-#: ../../c-api/init.rst:709 ../../c-api/init.rst:723
+#: ../../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:716
+#: ../../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:719
+#: ../../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:735
+#: ../../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:740
+#: ../../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 "
@@ -942,84 +1073,85 @@ msgid ""
"fatal condition is signalled using :c:func:`Py_FatalError`."
msgstr ""
-#: ../../c-api/init.rst:748
+#: ../../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:752
+#: ../../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:755
+#: ../../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:763 ../../c-api/init.rst:799
+#: ../../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:767
+#: ../../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:772
+#: ../../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:776
+#: ../../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:788
+#: ../../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:792
+#: ../../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:802
+#: ../../c-api/init.rst:880
msgid "The *updatepath* value depends on :option:`-I`."
msgstr ""
-#: ../../c-api/init.rst:809
+#: ../../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:813
+#: ../../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:817
+#: ../../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 "
@@ -1027,18 +1159,24 @@ msgid ""
"this storage."
msgstr ""
-#: ../../c-api/init.rst:830
+#: ../../c-api/init.rst:908
msgid ""
-"Return the default \"home\", that is, the value set by a previous call to :c:"
-"func:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` "
+"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:844
+#: ../../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:926
msgid "Thread State and the Global Interpreter Lock"
msgstr ""
-#: ../../c-api/init.rst:851
+#: ../../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 "
@@ -1050,17 +1188,18 @@ msgid ""
"once instead of twice."
msgstr ""
-#: ../../c-api/init.rst:861
+#: ../../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:871
+#: ../../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 "
@@ -1068,17 +1207,17 @@ msgid ""
"retrieved using :c:func:`PyThreadState_Get`."
msgstr ""
-#: ../../c-api/init.rst:877
+#: ../../c-api/init.rst:959
msgid "Releasing the GIL from extension code"
msgstr ""
-#: ../../c-api/init.rst:879
+#: ../../c-api/init.rst:961
msgid ""
"Most extension code manipulating the :term:`GIL` has the following simple "
"structure::"
msgstr ""
-#: ../../c-api/init.rst:882
+#: ../../c-api/init.rst:964
msgid ""
"Save the thread state in a local variable.\n"
"Release the global interpreter lock.\n"
@@ -1087,29 +1226,29 @@ msgid ""
"Restore the thread state from the local variable."
msgstr ""
-#: ../../c-api/init.rst:888
+#: ../../c-api/init.rst:970
msgid "This is so common that a pair of macros exists to simplify it::"
msgstr ""
-#: ../../c-api/init.rst:890
+#: ../../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:898
+#: ../../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:902
+#: ../../c-api/init.rst:984
msgid "The block above expands to the following code::"
msgstr ""
-#: ../../c-api/init.rst:904
+#: ../../c-api/init.rst:986
msgid ""
"PyThreadState *_save;\n"
"\n"
@@ -1118,7 +1257,7 @@ msgid ""
"PyEval_RestoreThread(_save);"
msgstr ""
-#: ../../c-api/init.rst:914
+#: ../../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 "
@@ -1129,7 +1268,7 @@ msgid ""
"state, the lock must be acquired before storing the thread state pointer."
msgstr ""
-#: ../../c-api/init.rst:923
+#: ../../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 "
@@ -1139,21 +1278,21 @@ msgid ""
"compressing or hashing data."
msgstr ""
-#: ../../c-api/init.rst:934
+#: ../../c-api/init.rst:1016
msgid "Non-Python created threads"
msgstr ""
-#: ../../c-api/init.rst:936
+#: ../../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:943
+#: ../../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 "
@@ -1164,14 +1303,14 @@ msgid ""
"finally free the thread state data structure."
msgstr ""
-#: ../../c-api/init.rst:951
+#: ../../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:955
+#: ../../c-api/init.rst:1037
msgid ""
"PyGILState_STATE gstate;\n"
"gstate = PyGILState_Ensure();\n"
@@ -1184,20 +1323,20 @@ msgid ""
"PyGILState_Release(gstate);"
msgstr ""
-#: ../../c-api/init.rst:965
+#: ../../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:975
+#: ../../c-api/init.rst:1057
msgid "Cautions about fork()"
msgstr ""
-#: ../../c-api/init.rst:977
+#: ../../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 "
@@ -1206,7 +1345,7 @@ msgid ""
"CPython's runtime."
msgstr ""
-#: ../../c-api/init.rst:983
+#: ../../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` "
@@ -1216,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:998
+#: ../../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 "
@@ -1236,17 +1375,17 @@ msgid ""
"called immediately after."
msgstr ""
-#: ../../c-api/init.rst:1011
+#: ../../c-api/init.rst:1093
msgid "High-level API"
msgstr "高階 API"
-#: ../../c-api/init.rst:1013
+#: ../../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:1018
+#: ../../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 "
@@ -1254,7 +1393,7 @@ msgid ""
"in this structure."
msgstr ""
-#: ../../c-api/init.rst:1023
+#: ../../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 "
@@ -1262,52 +1401,41 @@ msgid ""
"which interpreter they belong."
msgstr ""
-#: ../../c-api/init.rst:1031
+#: ../../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:1036
+#: ../../c-api/init.rst:1118
msgid "This thread's interpreter state."
msgstr ""
-#: ../../c-api/init.rst:1047
+#: ../../c-api/init.rst:1129
msgid "Deprecated function which does nothing."
msgstr ""
-#: ../../c-api/init.rst:1049
+#: ../../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:1051
+#: ../../c-api/init.rst:1133
msgid "The function now does nothing."
msgstr "此函式現在不會做任何事情。"
-#: ../../c-api/init.rst:1054
+#: ../../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:1058
+#: ../../c-api/init.rst:1140
msgid ""
"This function cannot be called before :c:func:`Py_Initialize()` anymore."
msgstr ""
-#: ../../c-api/init.rst:1068
-msgid ""
-"Returns a non-zero value if :c:func:`PyEval_InitThreads` has been called. "
-"This function can be called without holding the GIL, and therefore can be "
-"used to avoid calls to the locking API when running single-threaded."
-msgstr ""
-
-#: ../../c-api/init.rst:1072
-msgid "The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`."
-msgstr ""
-
-#: ../../c-api/init.rst:1080
+#: ../../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 "
@@ -1315,7 +1443,7 @@ msgid ""
"acquired it."
msgstr ""
-#: ../../c-api/init.rst:1088
+#: ../../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 "
@@ -1323,80 +1451,97 @@ msgid ""
"ensues."
msgstr ""
-#: ../../c-api/init.rst:1094 ../../c-api/init.rst:1140
-#: ../../c-api/init.rst:1422
+#: ../../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 "
-"use :c:func:`!_Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the "
+"use :c:func:`Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the "
"interpreter is in process of being finalized before calling this function to "
"avoid unwanted termination."
msgstr ""
-#: ../../c-api/init.rst:1102
+#: ../../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:1109
+#: ../../c-api/init.rst:1176
+msgid "See also :c:func:`PyThreadState_GetUnchecked`."
+msgstr "也請見 :c:func:`PyThreadState_GetUnchecked`。"
+
+#: ../../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:1185
+msgid ""
+"In Python 3.5 to 3.12, the function was private and known as "
+"``_PyThreadState_UncheckedGet()``."
+msgstr ""
+
+#: ../../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:1114
+#: ../../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:1119
+#: ../../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:1129
+#: ../../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:1136
+#: ../../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:1148
+#: ../../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:1153
+#: ../../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:1159
+#: ../../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 "
@@ -1404,7 +1549,7 @@ msgid ""
"made on the main thread. This is mainly a helper/diagnostic function."
msgstr ""
-#: ../../c-api/init.rst:1167
+#: ../../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 "
@@ -1415,237 +1560,248 @@ msgid ""
"otherwise behave differently."
msgstr ""
-#: ../../c-api/init.rst:1179
+#: ../../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:1185
+#: ../../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:1193
+#: ../../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:1201
+#: ../../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:1207
+#: ../../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:1213
+#: ../../c-api/init.rst:1296
msgid "Low-level API"
msgstr "低階 API"
-#: ../../c-api/init.rst:1215
+#: ../../c-api/init.rst:1298
msgid ""
"All of the following functions must be called after :c:func:`Py_Initialize`."
msgstr ""
-#: ../../c-api/init.rst:1217
+#: ../../c-api/init.rst:1300
msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`."
msgstr ""
-#: ../../c-api/init.rst:1223
+#: ../../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:1227
+#: ../../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:1232
+#: ../../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:1235
+#: ../../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:1240
+#: ../../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:1247
+#: ../../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:1254
+#: ../../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:1257
+#: ../../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:1264
+#: ../../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: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:1271
+#: ../../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 need not be "
-"held. The thread state must have been reset with a previous call to :c:func:"
-"`PyThreadState_Clear`."
+"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`."
msgstr ""
-#: ../../c-api/init.rst:1279
+#: ../../c-api/init.rst:1365
msgid "Get the current frame of the Python thread state *tstate*."
msgstr ""
-#: ../../c-api/init.rst:1281
+#: ../../c-api/init.rst:1367
msgid ""
"Return a :term:`strong reference`. Return ``NULL`` if no frame is currently "
"executing."
msgstr ""
-#: ../../c-api/init.rst:1284
+#: ../../c-api/init.rst:1370
msgid "See also :c:func:`PyEval_GetFrame`."
msgstr "也請見 :c:func:`PyEval_GetFrame`。"
-#: ../../c-api/init.rst:1286 ../../c-api/init.rst:1295
-#: ../../c-api/init.rst:1304
+#: ../../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:1293
+#: ../../c-api/init.rst:1379
msgid ""
"Get the unique thread state identifier of the Python thread state *tstate*."
msgstr ""
-#: ../../c-api/init.rst:1302
+#: ../../c-api/init.rst:1388
msgid "Get the interpreter of the Python thread state *tstate*."
msgstr ""
-#: ../../c-api/init.rst:1311
+#: ../../c-api/init.rst:1397
msgid "Suspend tracing and profiling in the Python thread state *tstate*."
msgstr ""
-#: ../../c-api/init.rst:1313
+#: ../../c-api/init.rst:1399
msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function."
msgstr ""
-#: ../../c-api/init.rst:1320
+#: ../../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:1323
+#: ../../c-api/init.rst:1409
msgid ""
"See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions."
msgstr ""
-#: ../../c-api/init.rst:1331
+#: ../../c-api/init.rst:1417
msgid "Get the current interpreter."
msgstr ""
-#: ../../c-api/init.rst:1333
+#: ../../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:1336 ../../c-api/init.rst:1346
+#: ../../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:1343
+#: ../../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:1353
+#: ../../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:1357
+#: ../../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:1364
+#: ../../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:1366
+#: ../../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:1369
+#: ../../c-api/init.rst:1466
msgid "The function now takes a *tstate* parameter."
msgstr ""
-#: ../../c-api/init.rst:1372
+#: ../../c-api/init.rst:1469
msgid ""
"The *frame* parameter changed from ``PyFrameObject*`` to "
"``_PyInterpreterFrame*``."
msgstr ""
-#: ../../c-api/init.rst:1377
+#: ../../c-api/init.rst:1474
msgid "Get the frame evaluation function."
msgstr ""
-#: ../../c-api/init.rst:1379 ../../c-api/init.rst:1387
+#: ../../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:1385
+#: ../../c-api/init.rst:1482
msgid "Set the frame evaluation function."
msgstr ""
-#: ../../c-api/init.rst:1394
+#: ../../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 "
@@ -1654,7 +1810,7 @@ msgid ""
"raised and the caller should assume no current thread state is available."
msgstr ""
-#: ../../c-api/init.rst:1403
+#: ../../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. "
@@ -1666,33 +1822,34 @@ msgid ""
"raises no exceptions."
msgstr ""
-#: ../../c-api/init.rst:1411
+#: ../../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:1417
+#: ../../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:1428 ../../c-api/init.rst:1466
+#: ../../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:1433
+#: ../../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:1439
+#: ../../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 "
@@ -1701,50 +1858,17 @@ msgid ""
"isn't, a fatal error is reported."
msgstr ""
-#: ../../c-api/init.rst:1445
+#: ../../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:1451
-msgid ""
-"Acquire the global interpreter lock. The lock must have been created "
-"earlier. If this thread already has the lock, a deadlock ensues."
-msgstr ""
-
-#: ../../c-api/init.rst:1454
-msgid ""
-"This function does not update the current thread state. Please use :c:func:"
-"`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread` instead."
-msgstr ""
-
-#: ../../c-api/init.rst:1460
-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 "
-"use :c:func:`_Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the "
-"interpreter is in process of being finalized before calling this function to "
-"avoid unwanted termination."
-msgstr ""
-
-#: ../../c-api/init.rst:1474
-msgid ""
-"Release the global interpreter lock. The lock must have been created "
-"earlier."
-msgstr ""
-
-#: ../../c-api/init.rst:1476
-msgid ""
-"This function does not update the current thread state. Please use :c:func:"
-"`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread` instead."
-msgstr ""
-
-#: ../../c-api/init.rst:1485
+#: ../../c-api/init.rst:1549
msgid "Sub-interpreter support"
msgstr ""
-#: ../../c-api/init.rst:1487
+#: ../../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 "
@@ -1752,7 +1876,7 @@ msgid ""
"to do that."
msgstr ""
-#: ../../c-api/init.rst:1492
+#: ../../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 "
@@ -1763,134 +1887,134 @@ msgid ""
"returns a pointer to its state."
msgstr ""
-#: ../../c-api/init.rst:1499
+#: ../../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:1505
+#: ../../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:1511
+#: ../../c-api/init.rst:1575
msgid "Structure fields:"
msgstr ""
-#: ../../c-api/init.rst:1515
+#: ../../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:1519
+#: ../../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:1527
+#: ../../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:1531
+#: ../../c-api/init.rst:1595
msgid ""
"Note that the :mod:`subprocess` module still works when fork is disallowed."
msgstr ""
-#: ../../c-api/init.rst:1536
+#: ../../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:1541
+#: ../../c-api/init.rst:1605
msgid ""
"Note that the :mod:`subprocess` module still works when exec is disallowed."
msgstr ""
-#: ../../c-api/init.rst:1546
+#: ../../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:1552
+#: ../../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:1559
+#: ../../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:1566
+#: ../../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:1571
+#: ../../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:1578
+#: ../../c-api/init.rst:1642
msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)."
msgstr ""
-#: ../../c-api/init.rst:1582
+#: ../../c-api/init.rst:1646
msgid "Use (share) the main interpreter's GIL."
msgstr ""
-#: ../../c-api/init.rst:1586
+#: ../../c-api/init.rst:1650
msgid "Use the sub-interpreter's own GIL."
msgstr ""
-#: ../../c-api/init.rst:1588
+#: ../../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:1602
+#: ../../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:1612
+#: ../../c-api/init.rst:1676
msgid ""
"The given *config* controls the options with which the interpreter is "
"initialized."
msgstr ""
-#: ../../c-api/init.rst:1615
+#: ../../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 "
@@ -1901,7 +2025,7 @@ msgid ""
"state."
msgstr ""
-#: ../../c-api/init.rst:1624
+#: ../../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. "
@@ -1913,13 +2037,13 @@ msgid ""
"released here."
msgstr ""
-#: ../../c-api/init.rst:1635
+#: ../../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:1638
+#: ../../c-api/init.rst:1702
msgid ""
"PyInterpreterConfig config = {\n"
" .use_main_obmalloc = 0,\n"
@@ -1930,7 +2054,11 @@ msgid ""
" .check_multi_interp_extensions = 1,\n"
" .gil = PyInterpreterConfig_OWN_GIL,\n"
"};\n"
-"PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);"
+"PyThreadState *tstate = NULL;\n"
+"PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);\n"
+"if (PyStatus_Exception(status)) {\n"
+" Py_ExitStatusException(status);\n"
+"}"
msgstr ""
"PyInterpreterConfig config = {\n"
" .use_main_obmalloc = 0,\n"
@@ -1941,60 +2069,65 @@ msgstr ""
" .check_multi_interp_extensions = 1,\n"
" .gil = PyInterpreterConfig_OWN_GIL,\n"
"};\n"
-"PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);"
+"PyThreadState *tstate = NULL;\n"
+"PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);\n"
+"if (PyStatus_Exception(status)) {\n"
+" Py_ExitStatusException(status);\n"
+"}"
-#: ../../c-api/init.rst:1649
+#: ../../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:1658
+#: ../../c-api/init.rst:1726
msgid "Extension modules are shared between (sub-)interpreters as follows:"
msgstr ""
-#: ../../c-api/init.rst:1660
+#: ../../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:1666
+#: ../../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:1677
+#: ../../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:1697
+#: ../../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:1709
+#: ../../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 "
@@ -2004,17 +2137,17 @@ msgid ""
"be held before calling this function. No GIL is held when it returns."
msgstr ""
-#: ../../c-api/init.rst:1717
+#: ../../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:1722
+#: ../../c-api/init.rst:1790
msgid "A Per-Interpreter GIL"
-msgstr ""
+msgstr "直譯器各別持有的 GIL"
-#: ../../c-api/init.rst:1724
+#: ../../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 "
@@ -2026,7 +2159,7 @@ msgid ""
"just using threads. (See :pep:`554`.)"
msgstr ""
-#: ../../c-api/init.rst:1734
+#: ../../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 "
@@ -2035,12 +2168,12 @@ msgid ""
"the refcount. One simple but less-efficient approach around this is to use "
"a global lock around all use of some state (or object). Alternately, "
"effectively immutable objects (like integers or strings) can be made safe in "
-"spite of their refcounts by making them \"immortal\". In fact, this has been "
-"done for the builtin singletons, small integers, and a number of other "
+"spite of their refcounts by making them :term:`immortal`. In fact, this has "
+"been done for the builtin singletons, small integers, and a number of other "
"builtin objects."
msgstr ""
-#: ../../c-api/init.rst:1745
+#: ../../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 "
@@ -2048,7 +2181,7 @@ msgid ""
"threading, including races and hard-to-debug crashes."
msgstr ""
-#: ../../c-api/init.rst:1750
+#: ../../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) "
@@ -2058,11 +2191,11 @@ msgid ""
"sharing) data between interpreters."
msgstr ""
-#: ../../c-api/init.rst:1761
+#: ../../c-api/init.rst:1829
msgid "Bugs and caveats"
msgstr ""
-#: ../../c-api/init.rst:1763
+#: ../../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 "
@@ -2075,7 +2208,7 @@ msgid ""
"should be avoided if possible."
msgstr ""
-#: ../../c-api/init.rst:1773
+#: ../../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 "
@@ -2084,37 +2217,37 @@ msgid ""
"objects from which the above are reachable."
msgstr ""
-#: ../../c-api/init.rst:1779
+#: ../../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:1790
+#: ../../c-api/init.rst:1858
msgid "Asynchronous Notifications"
msgstr ""
-#: ../../c-api/init.rst:1792
+#: ../../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:1799
+#: ../../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:1803
+#: ../../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 "
@@ -2122,17 +2255,17 @@ msgid ""
"these conditions met:"
msgstr ""
-#: ../../c-api/init.rst:1808
+#: ../../c-api/init.rst:1876
msgid "on a :term:`bytecode` boundary;"
msgstr ""
-#: ../../c-api/init.rst:1809
+#: ../../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:1812
+#: ../../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 "
@@ -2140,30 +2273,30 @@ msgid ""
"if the global interpreter lock is released."
msgstr ""
-#: ../../c-api/init.rst:1817
+#: ../../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:1820
+#: ../../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:1825
+#: ../../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:1834
+#: ../../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 "
@@ -2171,18 +2304,18 @@ msgid ""
"scheduled calls."
msgstr ""
-#: ../../c-api/init.rst:1843
+#: ../../c-api/init.rst:1911
msgid "Profiling and Tracing"
msgstr ""
-#: ../../c-api/init.rst:1848
+#: ../../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:1852
+#: ../../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 "
@@ -2192,78 +2325,76 @@ msgid ""
"reported to the Python-level trace functions in previous versions."
msgstr ""
-#: ../../c-api/init.rst:1862
+#: ../../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:1871
+#: ../../c-api/init.rst:1939
msgid "Value of *what*"
msgstr ""
-#: ../../c-api/init.rst:1871
+#: ../../c-api/init.rst:1939
msgid "Meaning of *arg*"
msgstr "*arg* 的含義"
-#: ../../c-api/init.rst:1873
+#: ../../c-api/init.rst:1941
msgid ":c:data:`PyTrace_CALL`"
msgstr ":c:data:`PyTrace_CALL`"
-#: ../../c-api/init.rst:1873 ../../c-api/init.rst:1878
-#: ../../c-api/init.rst:1889
+#: ../../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:1875
+#: ../../c-api/init.rst:1943
msgid ":c:data:`PyTrace_EXCEPTION`"
msgstr ":c:data:`PyTrace_EXCEPTION`"
-#: ../../c-api/init.rst:1875
+#: ../../c-api/init.rst:1943
msgid "Exception information as returned by :func:`sys.exc_info`."
msgstr ""
-#: ../../c-api/init.rst:1878
+#: ../../c-api/init.rst:1946
msgid ":c:data:`PyTrace_LINE`"
msgstr ":c:data:`PyTrace_LINE`"
-#: ../../c-api/init.rst:1880
+#: ../../c-api/init.rst:1948
msgid ":c:data:`PyTrace_RETURN`"
msgstr ":c:data:`PyTrace_RETURN`"
-#: ../../c-api/init.rst:1880
+#: ../../c-api/init.rst:1948
msgid ""
"Value being returned to the caller, or ``NULL`` if caused by an exception."
msgstr ""
-#: ../../c-api/init.rst:1883
+#: ../../c-api/init.rst:1951
msgid ":c:data:`PyTrace_C_CALL`"
msgstr ":c:data:`PyTrace_C_CALL`"
-#: ../../c-api/init.rst:1883 ../../c-api/init.rst:1885
-#: ../../c-api/init.rst:1887
+#: ../../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:1885
+#: ../../c-api/init.rst:1953
msgid ":c:data:`PyTrace_C_EXCEPTION`"
msgstr ":c:data:`PyTrace_C_EXCEPTION`"
-#: ../../c-api/init.rst:1887
+#: ../../c-api/init.rst:1955
msgid ":c:data:`PyTrace_C_RETURN`"
msgstr ":c:data:`PyTrace_C_RETURN`"
-#: ../../c-api/init.rst:1889
+#: ../../c-api/init.rst:1957
msgid ":c:data:`PyTrace_OPCODE`"
msgstr ":c:data:`PyTrace_OPCODE`"
-#: ../../c-api/init.rst:1894
+#: ../../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 "
@@ -2272,7 +2403,7 @@ msgid ""
"the corresponding frame."
msgstr ""
-#: ../../c-api/init.rst:1903
+#: ../../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 "
@@ -2284,148 +2415,204 @@ msgid ""
"profiler."
msgstr ""
-#: ../../c-api/init.rst:1914
+#: ../../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:1922
+#: ../../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:1928
+#: ../../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:1934
+#: ../../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:1940
+#: ../../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:1946
+#: ../../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:1954
+#: ../../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:1961
+#: ../../c-api/init.rst:2029
msgid "See also the :func:`sys.setprofile` function."
msgstr ""
-#: ../../c-api/init.rst:1963 ../../c-api/init.rst:1970
-#: ../../c-api/init.rst:1989 ../../c-api/init.rst:1996
+#: ../../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:1967
+#: ../../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:1972
+#: ../../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:1980
+#: ../../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:1987
+#: ../../c-api/init.rst:2055
msgid "See also the :func:`sys.settrace` function."
msgstr "也請見 :func:`sys.settrace` 函式。"
-#: ../../c-api/init.rst:1993
+#: ../../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:1998
+#: ../../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:2007
+#: ../../c-api/init.rst:2072
+msgid "Reference tracing"
+msgstr ""
+
+#: ../../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."
+msgstr ""
+
+#: ../../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: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: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 "
+"**data** is provided it must be an opaque pointer that will be provided when "
+"the tracer function is called. Return ``0`` on success. Set an exception and "
+"return ``-1`` on error."
+msgstr ""
+
+#: ../../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 "
+"any existing exception or set an exception. The GIL will be held every time "
+"the tracer function is called."
+msgstr ""
+
+#: ../../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: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 "
+"called. If no tracer was registered this function will return NULL and will "
+"set the **data** pointer to NULL."
+msgstr ""
+
+#: ../../c-api/init.rst:2127
msgid "Advanced Debugger Support"
msgstr ""
-#: ../../c-api/init.rst:2012
+#: ../../c-api/init.rst:2132
msgid ""
"These functions are only intended to be used by advanced debugging tools."
msgstr ""
-#: ../../c-api/init.rst:2017
+#: ../../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:2022
+#: ../../c-api/init.rst:2142
msgid "Return the main interpreter state object."
msgstr ""
-#: ../../c-api/init.rst:2027
+#: ../../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:2033
+#: ../../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:2039
+#: ../../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:2046
+#: ../../c-api/init.rst:2166
msgid "Thread Local Storage Support"
msgstr ""
-#: ../../c-api/init.rst:2050
+#: ../../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 "
@@ -2435,42 +2622,42 @@ msgid ""
"thread."
msgstr ""
-#: ../../c-api/init.rst:2057
+#: ../../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:2060
+#: ../../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:2064
+#: ../../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:2072
+#: ../../c-api/init.rst:2192
msgid "Thread Specific Storage (TSS) API"
msgstr ""
-#: ../../c-api/init.rst:2074
+#: ../../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:2080
+#: ../../c-api/init.rst:2200
msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)"
msgstr ""
-#: ../../c-api/init.rst:2085
+#: ../../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 "
@@ -2478,66 +2665,67 @@ msgid ""
"public members in this structure."
msgstr ""
-#: ../../c-api/init.rst:2090
+#: ../../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:2096
+#: ../../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:2101
+#: ../../c-api/init.rst:2221
msgid "Dynamic Allocation"
msgstr ""
-#: ../../c-api/init.rst:2103
+#: ../../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:2110
+#: ../../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:2117
+#: ../../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:2123
+#: ../../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:2128
+#: ../../c-api/init.rst:2248
msgid "Methods"
msgstr "方法"
-#: ../../c-api/init.rst:2130
+#: ../../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:2138
+#: ../../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:2144
+#: ../../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 "
@@ -2546,40 +2734,40 @@ msgid ""
"no-op and immediately returns success."
msgstr ""
-#: ../../c-api/init.rst:2153
+#: ../../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:2162
+#: ../../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:2169
+#: ../../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:2177
+#: ../../c-api/init.rst:2297
msgid "Thread Local Storage (TLS) API"
msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:"
-#: ../../c-api/init.rst:2179
+#: ../../c-api/init.rst:2299
msgid ""
"This API is superseded by :ref:`Thread Specific Storage (TSS) API `."
msgstr ""
-#: ../../c-api/init.rst:2184
+#: ../../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 "
@@ -2588,190 +2776,332 @@ msgid ""
"platforms."
msgstr ""
-#: ../../c-api/init.rst:2189
+#: ../../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:334 ../../c-api/init.rst:502 ../../c-api/init.rst:577
-msgid "Py_SetProgramName()"
-msgstr "Py_SetProgramName()"
+#: ../../c-api/init.rst:2320
+msgid "Synchronization Primitives"
+msgstr ""
+
+#: ../../c-api/init.rst:2322
+msgid "The C-API provides a basic mutual exclusion lock."
+msgstr ""
+
+#: ../../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:2329
+msgid "PyMutex mutex = {0};"
+msgstr ""
+
+#: ../../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: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: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:2353
+msgid ""
+"Unlock mutex *m*. The mutex must be locked --- otherwise, the function will "
+"issue a fatal error."
+msgstr ""
+
+#: ../../c-api/init.rst:2361
+msgid "Python Critical Section API"
+msgstr ""
+
+#: ../../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 "
+"intended to replace reliance on the :term:`global interpreter lock`, and are "
+"no-ops in versions of Python with the global interpreter lock."
+msgstr ""
+
+#: ../../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`."
+msgstr ""
+
+#: ../../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 "
+"expansions. Note that the sizes and contents of the structures may change in "
+"future Python versions."
+msgstr ""
+
+#: ../../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."
+msgstr ""
+
+#: ../../c-api/init.rst:2388
+msgid "Example usage::"
+msgstr ""
+
+#: ../../c-api/init.rst:2390
+msgid ""
+"static PyObject *\n"
+"set_field(MyObject *self, PyObject *value)\n"
+"{\n"
+" Py_BEGIN_CRITICAL_SECTION(self);\n"
+" Py_SETREF(self->field, Py_XNewRef(value));\n"
+" Py_END_CRITICAL_SECTION();\n"
+" Py_RETURN_NONE;\n"
+"}"
+msgstr ""
+
+#: ../../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`."
+msgstr ""
+
+#: ../../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: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:2412
+msgid ""
+"{\n"
+" PyCriticalSection _py_cs;\n"
+" PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))"
+msgstr ""
+
+#: ../../c-api/init.rst:2416 ../../c-api/init.rst:2445
+msgid "In the default build, this macro expands to ``{``."
+msgstr ""
+
+#: ../../c-api/init.rst:2422
+msgid "Ends the critical section and releases the per-object lock."
+msgstr ""
-#: ../../c-api/init.rst:334
+#: ../../c-api/init.rst:2426
+msgid ""
+" PyCriticalSection_End(&_py_cs);\n"
+"}"
+msgstr ""
+
+#: ../../c-api/init.rst:2429 ../../c-api/init.rst:2458
+msgid "In the default build, this macro expands to ``}``."
+msgstr ""
+
+#: ../../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:2441
+msgid ""
+"{\n"
+" PyCriticalSection2 _py_cs2;\n"
+" PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))"
+msgstr ""
+
+#: ../../c-api/init.rst:2451
+msgid "Ends the critical section and releases the per-object locks."
+msgstr ""
+
+#: ../../c-api/init.rst:2455
+msgid ""
+" PyCriticalSection2_End(&_py_cs2);\n"
+"}"
+msgstr ""
+
+#: ../../c-api/init.rst:350
msgid "PyEval_InitThreads()"
msgstr "PyEval_InitThreads()"
-#: ../../c-api/init.rst:334
+#: ../../c-api/init.rst:350
msgid "modules (in module sys)"
msgstr "modules(sys 模組中)"
-#: ../../c-api/init.rst:334 ../../c-api/init.rst:596 ../../c-api/init.rst:622
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:710
msgid "path (in module sys)"
msgstr "path(sys 模組中)"
-#: ../../c-api/init.rst:334 ../../c-api/init.rst:596 ../../c-api/init.rst:622
-#: ../../c-api/init.rst:1063 ../../c-api/init.rst:1594
-#: ../../c-api/init.rst:1689
+#: ../../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:334 ../../c-api/init.rst:1594 ../../c-api/init.rst:1689
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "builtins"
msgstr "builtins(內建)"
-#: ../../c-api/init.rst:334 ../../c-api/init.rst:1594 ../../c-api/init.rst:1689
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "__main__"
msgstr "__main__"
-#: ../../c-api/init.rst:334 ../../c-api/init.rst:1594 ../../c-api/init.rst:1689
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "sys"
msgstr "sys"
-#: ../../c-api/init.rst:334 ../../c-api/init.rst:596 ../../c-api/init.rst:622
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:710
msgid "search"
msgstr "search(搜尋)"
-#: ../../c-api/init.rst:334 ../../c-api/init.rst:596 ../../c-api/init.rst:622
+#: ../../c-api/init.rst:350 ../../c-api/init.rst:710
msgid "path"
msgstr "path(路徑)"
-#: ../../c-api/init.rst:334
-msgid "PySys_SetArgv (C function)"
-msgstr "PySys_SetArgv(C 函式)"
-
-#: ../../c-api/init.rst:334
-msgid "PySys_SetArgvEx (C function)"
-msgstr "PySys_SetArgvEx(C 函式)"
-
-#: ../../c-api/init.rst:334 ../../c-api/init.rst:1654 ../../c-api/init.rst:1707
+#: ../../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:437 ../../c-api/init.rst:474
+#: ../../c-api/init.rst:576
msgid "Py_Initialize()"
msgstr "Py_Initialize()"
-#: ../../c-api/init.rst:437 ../../c-api/init.rst:474 ../../c-api/init.rst:730
+#: ../../c-api/init.rst:576 ../../c-api/init.rst:808
msgid "main()"
msgstr "main()"
-#: ../../c-api/init.rst:437
-msgid "stdin"
-msgstr "stdin"
-
-#: ../../c-api/init.rst:437
-msgid "stdout"
-msgstr "stdout"
-
-#: ../../c-api/init.rst:437
-msgid "sdterr"
-msgstr "sdterr"
-
-#: ../../c-api/init.rst:474 ../../c-api/init.rst:622
+#: ../../c-api/init.rst:576
msgid "Py_GetPath()"
msgstr "Py_GetPath()"
-#: ../../c-api/init.rst:577
+#: ../../c-api/init.rst:689
msgid "executable (in module sys)"
msgstr "executable(sys 模組中)"
-#: ../../c-api/init.rst:596
-msgid "Py_SetPath()"
-msgstr "Py_SetPath()"
-
-#: ../../c-api/init.rst:665 ../../c-api/init.rst:707 ../../c-api/init.rst:721
+#: ../../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:677
+#: ../../c-api/init.rst:755
msgid "platform (in module sys)"
msgstr "platform(sys 模組中)"
-#: ../../c-api/init.rst:694
+#: ../../c-api/init.rst:772
msgid "copyright (in module sys)"
msgstr "copyright(sys 模組中)"
-#: ../../c-api/init.rst:730
+#: ../../c-api/init.rst:808
msgid "Py_FatalError()"
msgstr "Py_FatalError()"
-#: ../../c-api/init.rst:730
+#: ../../c-api/init.rst:808
msgid "argv (in module sys)"
msgstr "argv(sys 模組中)"
-#: ../../c-api/init.rst:846
+#: ../../c-api/init.rst:928
msgid "global interpreter lock"
msgstr "global interpreter lock(全域直譯器鎖)"
-#: ../../c-api/init.rst:846
+#: ../../c-api/init.rst:928
msgid "interpreter lock"
msgstr "interpreter lock(直譯器鎖)"
-#: ../../c-api/init.rst:846
+#: ../../c-api/init.rst:928
msgid "lock, interpreter"
msgstr "lock, interpreter(鎖、直譯器)"
-#: ../../c-api/init.rst:859
+#: ../../c-api/init.rst:941
msgid "setswitchinterval (in module sys)"
msgstr "setswitchinterval (sys 模組中)"
-#: ../../c-api/init.rst:868
+#: ../../c-api/init.rst:950
msgid "PyThreadState (C type)"
msgstr "PyThreadState(C 型別)"
-#: ../../c-api/init.rst:894
+#: ../../c-api/init.rst:976
msgid "Py_BEGIN_ALLOW_THREADS (C macro)"
msgstr "Py_BEGIN_ALLOW_THREADS(C 巨集)"
-#: ../../c-api/init.rst:894
+#: ../../c-api/init.rst:976
msgid "Py_END_ALLOW_THREADS (C macro)"
msgstr "Py_END_ALLOW_THREADS(C 巨集)"
-#: ../../c-api/init.rst:910
+#: ../../c-api/init.rst:992
msgid "PyEval_RestoreThread (C function)"
msgstr "PyEval_RestoreThread(C 函式)"
-#: ../../c-api/init.rst:910
+#: ../../c-api/init.rst:992
msgid "PyEval_SaveThread (C function)"
msgstr "PyEval_SaveThread(C 函式)"
-#: ../../c-api/init.rst:1041
+#: ../../c-api/init.rst:1123
msgid "PyEval_AcquireThread()"
msgstr "PyEval_AcquireThread()"
-#: ../../c-api/init.rst:1041
+#: ../../c-api/init.rst:1123
msgid "PyEval_ReleaseThread()"
msgstr "PyEval_ReleaseThread()"
-#: ../../c-api/init.rst:1041
+#: ../../c-api/init.rst:1123
msgid "PyEval_SaveThread()"
msgstr "PyEval_SaveThread()"
-#: ../../c-api/init.rst:1041
+#: ../../c-api/init.rst:1123
msgid "PyEval_RestoreThread()"
msgstr "PyEval_RestoreThread()"
-#: ../../c-api/init.rst:1063
+#: ../../c-api/init.rst:1145
msgid "_thread"
msgstr "_thread"
-#: ../../c-api/init.rst:1594 ../../c-api/init.rst:1689
+#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "stdout (in module sys)"
msgstr "stdout(sys 模組中)"
-#: ../../c-api/init.rst:1594 ../../c-api/init.rst:1689
+#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "stderr (in module sys)"
msgstr "stderr(sys 模組中)"
-#: ../../c-api/init.rst:1594 ../../c-api/init.rst:1689
+#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757
msgid "stdin (in module sys)"
msgstr "stdin(sys 模組中)"
-#: ../../c-api/init.rst:1654
+#: ../../c-api/init.rst:1722
msgid "Py_Initialize (C function)"
msgstr "Py_Initialize(C 函式)"
-#: ../../c-api/init.rst:1684
+#: ../../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 b2ac9bf415..3397a5853b 100644
--- a/c-api/init_config.po
+++ b/c-api/init_config.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-09-07 03:11+0800\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-"
@@ -149,7 +149,7 @@ msgid "*index* must be greater than or equal to ``0``."
msgstr ""
#: ../../c-api/init_config.rst:108 ../../c-api/init_config.rst:128
-#: ../../c-api/init_config.rst:235 ../../c-api/init_config.rst:544
+#: ../../c-api/init_config.rst:235 ../../c-api/init_config.rst:554
msgid "Structure fields:"
msgstr ""
@@ -355,116 +355,135 @@ msgid ""
"allocator ` with :ref:`debug hooks `."
msgstr ""
-#: ../../c-api/init_config.rst:257
+#: ../../c-api/init_config.rst:256
+msgid ""
+"``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): use ``mimalloc``, a fast malloc "
+"replacement."
+msgstr ""
+
+#: ../../c-api/init_config.rst:258
+msgid ""
+"``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): use ``mimalloc``, a fast malloc "
+"replacement with :ref:`debug hooks `."
+msgstr ""
+
+#: ../../c-api/init_config.rst:262
msgid ""
"``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not "
"supported if Python is :option:`configured using --without-pymalloc <--"
"without-pymalloc>`."
msgstr ""
-#: ../../c-api/init_config.rst:261
+#: ../../c-api/init_config.rst:266
+msgid ""
+"``PYMEM_ALLOCATOR_MIMALLOC`` and ``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` are not "
+"supported if Python is :option:`configured using --without-mimalloc <--"
+"without-mimalloc>` or if the underlying atomic support isn't available."
+msgstr ""
+
+#: ../../c-api/init_config.rst:271
msgid "See :ref:`Memory Management `."
msgstr "請見\\ :ref:`記憶體管理 `。"
-#: ../../c-api/init_config.rst:263
+#: ../../c-api/init_config.rst:273
msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``."
msgstr "預設:``PYMEM_ALLOCATOR_NOT_SET``。"
-#: ../../c-api/init_config.rst:267
+#: ../../c-api/init_config.rst:277
msgid "Set the LC_CTYPE locale to the user preferred locale."
msgstr ""
-#: ../../c-api/init_config.rst:269
+#: ../../c-api/init_config.rst:279
msgid ""
"If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:"
"member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``."
msgstr ""
-#: ../../c-api/init_config.rst:272 ../../c-api/init_config.rst:283
+#: ../../c-api/init_config.rst:282 ../../c-api/init_config.rst:293
msgid "See the :term:`locale encoding`."
msgstr "請見 :term:`locale encoding`。"
-#: ../../c-api/init_config.rst:274 ../../c-api/init_config.rst:329
-#: ../../c-api/init_config.rst:684
+#: ../../c-api/init_config.rst:284 ../../c-api/init_config.rst:339
+#: ../../c-api/init_config.rst:710
msgid "Default: ``1`` in Python config, ``0`` in isolated config."
msgstr ""
-#: ../../c-api/init_config.rst:278
+#: ../../c-api/init_config.rst:288
msgid "If equals to ``2``, coerce the C locale."
msgstr ""
-#: ../../c-api/init_config.rst:280
+#: ../../c-api/init_config.rst:290
msgid ""
"If equals to ``1``, read the LC_CTYPE locale to decide if it should be "
"coerced."
msgstr ""
-#: ../../c-api/init_config.rst:285 ../../c-api/init_config.rst:291
+#: ../../c-api/init_config.rst:295 ../../c-api/init_config.rst:301
msgid "Default: ``-1`` in Python config, ``0`` in isolated config."
msgstr ""
-#: ../../c-api/init_config.rst:289
+#: ../../c-api/init_config.rst:299
msgid "If non-zero, emit a warning if the C locale is coerced."
msgstr ""
-#: ../../c-api/init_config.rst:295
+#: ../../c-api/init_config.rst:305
msgid ""
":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`."
msgstr ""
-#: ../../c-api/init_config.rst:298 ../../c-api/init_config.rst:693
-#: ../../c-api/init_config.rst:735 ../../c-api/init_config.rst:1188
+#: ../../c-api/init_config.rst:308 ../../c-api/init_config.rst:719
+#: ../../c-api/init_config.rst:765 ../../c-api/init_config.rst:1244
msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode."
msgstr ""
-#: ../../c-api/init_config.rst:302
+#: ../../c-api/init_config.rst:312
msgid "Isolated mode: see :c:member:`PyConfig.isolated`."
msgstr ""
-#: ../../c-api/init_config.rst:304 ../../c-api/init_config.rst:880
+#: ../../c-api/init_config.rst:314 ../../c-api/init_config.rst:921
msgid "Default: ``0`` in Python mode, ``1`` in isolated mode."
msgstr ""
-#: ../../c-api/init_config.rst:308
+#: ../../c-api/init_config.rst:318
msgid "If non-zero:"
msgstr "如果不為 0:"
-#: ../../c-api/init_config.rst:310
+#: ../../c-api/init_config.rst:320
msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``,"
msgstr "將 :c:member:`PyPreConfig.utf8_mode` 設為 ``0``、"
-#: ../../c-api/init_config.rst:311
+#: ../../c-api/init_config.rst:321
msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``,"
msgstr "將 :c:member:`PyConfig.filesystem_encoding` 設為 ``\"mbcs\"``、"
-#: ../../c-api/init_config.rst:312
+#: ../../c-api/init_config.rst:322
msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``."
msgstr "將 :c:member:`PyConfig.filesystem_errors` 設為 ``\"replace\"``。"
-#: ../../c-api/init_config.rst:314
+#: ../../c-api/init_config.rst:324
msgid ""
"Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment "
"variable value."
msgstr ""
-#: ../../c-api/init_config.rst:317 ../../c-api/init_config.rst:894
+#: ../../c-api/init_config.rst:327 ../../c-api/init_config.rst:935
msgid ""
"Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for "
"Windows specific code."
msgstr ""
-#: ../../c-api/init_config.rst:320 ../../c-api/init_config.rst:632
-#: ../../c-api/init_config.rst:639 ../../c-api/init_config.rst:706
-#: ../../c-api/init_config.rst:815 ../../c-api/init_config.rst:829
-#: ../../c-api/init_config.rst:843 ../../c-api/init_config.rst:897
-#: ../../c-api/init_config.rst:911 ../../c-api/init_config.rst:971
-#: ../../c-api/init_config.rst:1023 ../../c-api/init_config.rst:1083
-#: ../../c-api/init_config.rst:1123 ../../c-api/init_config.rst:1152
-#: ../../c-api/init_config.rst:1239
+#: ../../c-api/init_config.rst:330 ../../c-api/init_config.rst:658
+#: ../../c-api/init_config.rst:665 ../../c-api/init_config.rst:732
+#: ../../c-api/init_config.rst:843 ../../c-api/init_config.rst:857
+#: ../../c-api/init_config.rst:871 ../../c-api/init_config.rst:938
+#: ../../c-api/init_config.rst:952 ../../c-api/init_config.rst:1012
+#: ../../c-api/init_config.rst:1064 ../../c-api/init_config.rst:1126
+#: ../../c-api/init_config.rst:1180 ../../c-api/init_config.rst:1209
+#: ../../c-api/init_config.rst:1298
msgid "Default: ``0``."
msgstr "預設:``0``。"
-#: ../../c-api/init_config.rst:324
+#: ../../c-api/init_config.rst:334
msgid ""
"If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:"
"`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way "
@@ -472,95 +491,95 @@ msgid ""
"Arguments `."
msgstr ""
-#: ../../c-api/init_config.rst:333
+#: ../../c-api/init_config.rst:343
msgid ""
"Use :ref:`environment variables `? See :c:member:`PyConfig."
"use_environment`."
msgstr ""
-#: ../../c-api/init_config.rst:336 ../../c-api/init_config.rst:1213
+#: ../../c-api/init_config.rst:346 ../../c-api/init_config.rst:1272
msgid "Default: ``1`` in Python config and ``0`` in isolated config."
msgstr ""
-#: ../../c-api/init_config.rst:340
+#: ../../c-api/init_config.rst:350
msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `."
msgstr ""
-#: ../../c-api/init_config.rst:342
+#: ../../c-api/init_config.rst:352
msgid ""
"Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and "
"the :envvar:`PYTHONUTF8` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:345
+#: ../../c-api/init_config.rst:355
msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``."
msgstr ""
-#: ../../c-api/init_config.rst:347
+#: ../../c-api/init_config.rst:357
msgid "Default: ``-1`` in Python config and ``0`` in isolated config."
msgstr ""
-#: ../../c-api/init_config.rst:353
+#: ../../c-api/init_config.rst:363
msgid "Preinitialize Python with PyPreConfig"
msgstr ""
-#: ../../c-api/init_config.rst:355
+#: ../../c-api/init_config.rst:365
msgid "The preinitialization of Python:"
msgstr ""
-#: ../../c-api/init_config.rst:357
+#: ../../c-api/init_config.rst:367
msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)"
msgstr ""
-#: ../../c-api/init_config.rst:358
+#: ../../c-api/init_config.rst:368
msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)"
msgstr ""
-#: ../../c-api/init_config.rst:359
+#: ../../c-api/init_config.rst:369
msgid ""
"Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig."
"utf8_mode`)"
msgstr ""
-#: ../../c-api/init_config.rst:362
+#: ../../c-api/init_config.rst:372
msgid ""
"The current preconfiguration (``PyPreConfig`` type) is stored in "
"``_PyRuntime.preconfig``."
msgstr ""
-#: ../../c-api/init_config.rst:365
+#: ../../c-api/init_config.rst:375
msgid "Functions to preinitialize Python:"
msgstr ""
-#: ../../c-api/init_config.rst:369 ../../c-api/init_config.rst:375
-#: ../../c-api/init_config.rst:384
+#: ../../c-api/init_config.rst:379 ../../c-api/init_config.rst:385
+#: ../../c-api/init_config.rst:394
msgid "Preinitialize Python from *preconfig* preconfiguration."
msgstr ""
-#: ../../c-api/init_config.rst:371 ../../c-api/init_config.rst:380
-#: ../../c-api/init_config.rst:389
+#: ../../c-api/init_config.rst:381 ../../c-api/init_config.rst:390
+#: ../../c-api/init_config.rst:399
msgid "*preconfig* must not be ``NULL``."
msgstr "*preconfig* 不可為 ``NULL``。"
-#: ../../c-api/init_config.rst:377
+#: ../../c-api/init_config.rst:387
msgid ""
"Parse *argv* command line arguments (bytes strings) if :c:member:"
"`~PyPreConfig.parse_argv` of *preconfig* is non-zero."
msgstr ""
-#: ../../c-api/init_config.rst:386
+#: ../../c-api/init_config.rst:396
msgid ""
"Parse *argv* command line arguments (wide strings) if :c:member:"
"`~PyPreConfig.parse_argv` of *preconfig* is non-zero."
msgstr ""
-#: ../../c-api/init_config.rst:391 ../../c-api/init_config.rst:1301
+#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1359
msgid ""
"The caller is responsible to handle exceptions (error or exit) using :c:func:"
"`PyStatus_Exception` and :c:func:`Py_ExitStatusException`."
msgstr ""
-#: ../../c-api/init_config.rst:394
+#: ../../c-api/init_config.rst:404
msgid ""
"For :ref:`Python Configuration ` (:c:func:"
"`PyPreConfig_InitPythonConfig`), if Python is initialized with command line "
@@ -570,7 +589,7 @@ msgid ""
"`Python UTF-8 Mode `."
msgstr ""
-#: ../../c-api/init_config.rst:401
+#: ../../c-api/init_config.rst:411
msgid ""
"``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and "
"before :c:func:`Py_InitializeFromConfig` to install a custom memory "
@@ -578,7 +597,7 @@ msgid ""
"`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``."
msgstr ""
-#: ../../c-api/init_config.rst:406
+#: ../../c-api/init_config.rst:416
msgid ""
"Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not "
"be used before the Python preinitialization, whereas calling directly "
@@ -586,13 +605,13 @@ msgid ""
"not be called before the Python preinitialization."
msgstr ""
-#: ../../c-api/init_config.rst:411
+#: ../../c-api/init_config.rst:421
msgid ""
"Example using the preinitialization to enable the :ref:`Python UTF-8 Mode "
"`::"
msgstr ""
-#: ../../c-api/init_config.rst:414
+#: ../../c-api/init_config.rst:424
msgid ""
"PyStatus status;\n"
"PyPreConfig preconfig;\n"
@@ -612,84 +631,84 @@ msgid ""
"Py_Finalize();"
msgstr ""
-#: ../../c-api/init_config.rst:433
+#: ../../c-api/init_config.rst:443
msgid "PyConfig"
msgstr "PyConfig"
-#: ../../c-api/init_config.rst:437
+#: ../../c-api/init_config.rst:447
msgid "Structure containing most parameters to configure Python."
msgstr ""
-#: ../../c-api/init_config.rst:439
+#: ../../c-api/init_config.rst:449
msgid ""
"When done, the :c:func:`PyConfig_Clear` function must be used to release the "
"configuration memory."
msgstr ""
-#: ../../c-api/init_config.rst:444
+#: ../../c-api/init_config.rst:454
msgid "Structure methods:"
msgstr ""
-#: ../../c-api/init_config.rst:448
+#: ../../c-api/init_config.rst:458
msgid ""
"Initialize configuration with the :ref:`Python Configuration `."
msgstr ""
-#: ../../c-api/init_config.rst:453
+#: ../../c-api/init_config.rst:463
msgid ""
"Initialize configuration with the :ref:`Isolated Configuration `."
msgstr ""
-#: ../../c-api/init_config.rst:458
+#: ../../c-api/init_config.rst:468
msgid "Copy the wide character string *str* into ``*config_str``."
msgstr ""
-#: ../../c-api/init_config.rst:460 ../../c-api/init_config.rst:467
-#: ../../c-api/init_config.rst:474 ../../c-api/init_config.rst:482
-#: ../../c-api/init_config.rst:488 ../../c-api/init_config.rst:505
+#: ../../c-api/init_config.rst:470 ../../c-api/init_config.rst:477
+#: ../../c-api/init_config.rst:484 ../../c-api/init_config.rst:492
+#: ../../c-api/init_config.rst:498 ../../c-api/init_config.rst:515
msgid ":ref:`Preinitialize Python ` if needed."
msgstr ""
-#: ../../c-api/init_config.rst:464
+#: ../../c-api/init_config.rst:474
msgid ""
"Decode *str* using :c:func:`Py_DecodeLocale` and set the result into "
"``*config_str``."
msgstr ""
-#: ../../c-api/init_config.rst:471
+#: ../../c-api/init_config.rst:481
msgid ""
"Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) "
"from the *argv* list of wide character strings."
msgstr ""
-#: ../../c-api/init_config.rst:478
+#: ../../c-api/init_config.rst:488
msgid ""
"Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) "
"from the *argv* list of bytes strings. Decode bytes using :c:func:"
"`Py_DecodeLocale`."
msgstr ""
-#: ../../c-api/init_config.rst:486
+#: ../../c-api/init_config.rst:496
msgid "Set the list of wide strings *list* to *length* and *items*."
msgstr ""
-#: ../../c-api/init_config.rst:492
+#: ../../c-api/init_config.rst:502
msgid "Read all Python configuration."
msgstr ""
-#: ../../c-api/init_config.rst:494
+#: ../../c-api/init_config.rst:504
msgid "Fields which are already initialized are left unchanged."
msgstr ""
-#: ../../c-api/init_config.rst:496
+#: ../../c-api/init_config.rst:506
msgid ""
"Fields for :ref:`path configuration ` are no longer "
"calculated or modified when calling this function, as of Python 3.11."
msgstr ""
-#: ../../c-api/init_config.rst:499 ../../c-api/init_config.rst:1000
+#: ../../c-api/init_config.rst:509 ../../c-api/init_config.rst:1041
msgid ""
"The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` "
"arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after "
@@ -698,25 +717,25 @@ msgid ""
"as Python options."
msgstr ""
-#: ../../c-api/init_config.rst:507
+#: ../../c-api/init_config.rst:517
msgid ""
"The :c:member:`PyConfig.argv` arguments are now only parsed once, :c:member:"
"`PyConfig.parse_argv` is set to ``2`` after arguments are parsed, and "
"arguments are only parsed if :c:member:`PyConfig.parse_argv` equals ``1``."
msgstr ""
-#: ../../c-api/init_config.rst:513
+#: ../../c-api/init_config.rst:523
msgid ""
":c:func:`PyConfig_Read` no longer calculates all paths, and so fields listed "
"under :ref:`Python Path Configuration ` may no longer be "
"updated until :c:func:`Py_InitializeFromConfig` is called."
msgstr ""
-#: ../../c-api/init_config.rst:521
+#: ../../c-api/init_config.rst:531
msgid "Release configuration memory."
msgstr ""
-#: ../../c-api/init_config.rst:523
+#: ../../c-api/init_config.rst:533
msgid ""
"Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. "
"In that case, the Python preinitialization configuration (:c:type:"
@@ -725,23 +744,23 @@ msgid ""
"before calling a :c:type:`PyConfig` method:"
msgstr ""
-#: ../../c-api/init_config.rst:529
+#: ../../c-api/init_config.rst:539
msgid ":c:member:`PyConfig.dev_mode`"
msgstr ":c:member:`PyConfig.dev_mode`"
-#: ../../c-api/init_config.rst:530
+#: ../../c-api/init_config.rst:540
msgid ":c:member:`PyConfig.isolated`"
msgstr ":c:member:`PyConfig.isolated`"
-#: ../../c-api/init_config.rst:531
+#: ../../c-api/init_config.rst:541
msgid ":c:member:`PyConfig.parse_argv`"
msgstr ":c:member:`PyConfig.parse_argv`"
-#: ../../c-api/init_config.rst:532
+#: ../../c-api/init_config.rst:542
msgid ":c:member:`PyConfig.use_environment`"
msgstr ":c:member:`PyConfig.use_environment`"
-#: ../../c-api/init_config.rst:534
+#: ../../c-api/init_config.rst:544
msgid ""
"Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` "
"is used, this method must be called before other methods, since the "
@@ -749,412 +768,435 @@ msgid ""
"member:`~PyConfig.parse_argv` is non-zero)."
msgstr ""
-#: ../../c-api/init_config.rst:539
+#: ../../c-api/init_config.rst:549
msgid ""
"The caller of these methods is responsible to handle exceptions (error or "
"exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``."
msgstr ""
-#: ../../c-api/init_config.rst:548
-msgid "Command line arguments: :data:`sys.argv`."
-msgstr "命令列引數::data:`sys.argv`。"
+#: ../../c-api/init_config.rst:562
+msgid ""
+"Set :data:`sys.argv` command line arguments based on :c:member:`~PyConfig."
+"argv`. These parameters are similar to those passed to the program's :c:"
+"func:`main` function with the difference that the first entry should refer "
+"to the script file to be executed rather than the executable hosting the "
+"Python interpreter. If there isn't a script that will be run, the first "
+"entry in :c:member:`~PyConfig.argv` can be an empty string."
+msgstr ""
-#: ../../c-api/init_config.rst:550
+#: ../../c-api/init_config.rst:570
msgid ""
"Set :c:member:`~PyConfig.parse_argv` to ``1`` to parse :c:member:`~PyConfig."
"argv` the same way the regular Python parses Python command line arguments "
"and then to strip Python arguments from :c:member:`~PyConfig.argv`."
msgstr ""
-#: ../../c-api/init_config.rst:555
+#: ../../c-api/init_config.rst:575
msgid ""
"If :c:member:`~PyConfig.argv` is empty, an empty string is added to ensure "
"that :data:`sys.argv` always exists and is never empty."
msgstr ""
-#: ../../c-api/init_config.rst:558 ../../c-api/init_config.rst:585
-#: ../../c-api/init_config.rst:597 ../../c-api/init_config.rst:605
-#: ../../c-api/init_config.rst:713 ../../c-api/init_config.rst:722
-#: ../../c-api/init_config.rst:804 ../../c-api/init_config.rst:941
-#: ../../c-api/init_config.rst:1042 ../../c-api/init_config.rst:1060
-#: ../../c-api/init_config.rst:1074 ../../c-api/init_config.rst:1091
-#: ../../c-api/init_config.rst:1104 ../../c-api/init_config.rst:1112
+#: ../../c-api/init_config.rst:578 ../../c-api/init_config.rst:605
+#: ../../c-api/init_config.rst:619 ../../c-api/init_config.rst:629
+#: ../../c-api/init_config.rst:739 ../../c-api/init_config.rst:750
+#: ../../c-api/init_config.rst:832 ../../c-api/init_config.rst:982
+#: ../../c-api/init_config.rst:1083 ../../c-api/init_config.rst:1102
+#: ../../c-api/init_config.rst:1117 ../../c-api/init_config.rst:1134
+#: ../../c-api/init_config.rst:1147 ../../c-api/init_config.rst:1155
+#: ../../c-api/init_config.rst:1169
msgid "Default: ``NULL``."
msgstr "預設值:``NULL``。"
-#: ../../c-api/init_config.rst:560
+#: ../../c-api/init_config.rst:580
msgid "See also the :c:member:`~PyConfig.orig_argv` member."
msgstr ""
-#: ../../c-api/init_config.rst:564
+#: ../../c-api/init_config.rst:584
msgid ""
"If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :"
"data:`sys.path` at startup:"
msgstr ""
-#: ../../c-api/init_config.rst:567
+#: ../../c-api/init_config.rst:587
msgid ""
"If :c:member:`argv[0] ` is equal to ``L\"-m\"`` (``python -m "
"module``), prepend the current working directory."
msgstr ""
-#: ../../c-api/init_config.rst:569
+#: ../../c-api/init_config.rst:589
msgid ""
"If running a script (``python script.py``), prepend the script's directory. "
"If it's a symbolic link, resolve symbolic links."
msgstr ""
-#: ../../c-api/init_config.rst:571
+#: ../../c-api/init_config.rst:591
msgid ""
"Otherwise (``python -c code`` and ``python``), prepend an empty string, "
"which means the current working directory."
msgstr ""
-#: ../../c-api/init_config.rst:574
+#: ../../c-api/init_config.rst:594
msgid ""
"Set to ``1`` by the :option:`-P` command line option and the :envvar:"
"`PYTHONSAFEPATH` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:577
+#: ../../c-api/init_config.rst:597
msgid "Default: ``0`` in Python config, ``1`` in isolated config."
msgstr ""
-#: ../../c-api/init_config.rst:583
+#: ../../c-api/init_config.rst:603
msgid ":data:`sys.base_exec_prefix`."
msgstr ":data:`sys.base_exec_prefix`。"
-#: ../../c-api/init_config.rst:587 ../../c-api/init_config.rst:599
-#: ../../c-api/init_config.rst:607 ../../c-api/init_config.rst:715
-#: ../../c-api/init_config.rst:724 ../../c-api/init_config.rst:958
-#: ../../c-api/init_config.rst:1044
+#: ../../c-api/init_config.rst:607 ../../c-api/init_config.rst:621
+#: ../../c-api/init_config.rst:631 ../../c-api/init_config.rst:741
+#: ../../c-api/init_config.rst:752 ../../c-api/init_config.rst:999
+#: ../../c-api/init_config.rst:1085
msgid "Part of the :ref:`Python Path Configuration ` output."
msgstr ""
-#: ../../c-api/init_config.rst:591
+#: ../../c-api/init_config.rst:609
+msgid "See also :c:member:`PyConfig.exec_prefix`."
+msgstr "也請見 :c:member:`PyConfig.exec_prefix`"
+
+#: ../../c-api/init_config.rst:613
msgid "Python base executable: :data:`sys._base_executable`."
msgstr ""
-#: ../../c-api/init_config.rst:593
+#: ../../c-api/init_config.rst:615
msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:595
+#: ../../c-api/init_config.rst:617
msgid "Set from :c:member:`PyConfig.executable` if ``NULL``."
msgstr ""
-#: ../../c-api/init_config.rst:603
+#: ../../c-api/init_config.rst:623
+msgid "See also :c:member:`PyConfig.executable`."
+msgstr "也請見 :c:member:`PyConfig.executable`"
+
+#: ../../c-api/init_config.rst:627
msgid ":data:`sys.base_prefix`."
msgstr ":data:`sys.base_prefix`。"
-#: ../../c-api/init_config.rst:611
+#: ../../c-api/init_config.rst:633
+msgid "See also :c:member:`PyConfig.prefix`."
+msgstr "也請見 :c:member:`PyConfig.prefix`"
+
+#: ../../c-api/init_config.rst:637
msgid ""
"If equals to ``0`` and :c:member:`~PyConfig.configure_c_stdio` is non-zero, "
"disable buffering on the C streams stdout and stderr."
msgstr ""
-#: ../../c-api/init_config.rst:614
+#: ../../c-api/init_config.rst:640
msgid ""
"Set to ``0`` by the :option:`-u` command line option and the :envvar:"
"`PYTHONUNBUFFERED` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:617
+#: ../../c-api/init_config.rst:643
msgid "stdin is always opened in buffered mode."
msgstr ""
-#: ../../c-api/init_config.rst:619 ../../c-api/init_config.rst:652
-#: ../../c-api/init_config.rst:1140 ../../c-api/init_config.rst:1271
+#: ../../c-api/init_config.rst:645 ../../c-api/init_config.rst:678
+#: ../../c-api/init_config.rst:1197 ../../c-api/init_config.rst:1330
msgid "Default: ``1``."
msgstr "預設值:``1``。"
-#: ../../c-api/init_config.rst:623
+#: ../../c-api/init_config.rst:649
msgid ""
"If equals to ``1``, issue a warning when comparing :class:`bytes` or :class:"
"`bytearray` with :class:`str`, or comparing :class:`bytes` with :class:`int`."
msgstr ""
-#: ../../c-api/init_config.rst:627
+#: ../../c-api/init_config.rst:653
msgid ""
"If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these "
"cases."
msgstr ""
-#: ../../c-api/init_config.rst:630
+#: ../../c-api/init_config.rst:656
msgid "Incremented by the :option:`-b` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:636
+#: ../../c-api/init_config.rst:662
msgid ""
"If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io."
"TextIOWrapper` uses its default encoding. See :ref:`io-encoding-warning` for "
"details."
msgstr ""
-#: ../../c-api/init_config.rst:645
+#: ../../c-api/init_config.rst:671
msgid ""
"If equals to ``0``, disables the inclusion of the end line and column "
"mappings in code objects. Also disables traceback printing carets to "
"specific error locations."
msgstr ""
-#: ../../c-api/init_config.rst:649
+#: ../../c-api/init_config.rst:675
msgid ""
"Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable and "
"by the :option:`-X no_debug_ranges <-X>` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:658
+#: ../../c-api/init_config.rst:684
msgid ""
"Control the validation behavior of hash-based ``.pyc`` files: value of the :"
"option:`--check-hash-based-pycs` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:661
+#: ../../c-api/init_config.rst:687
msgid "Valid values:"
msgstr ""
-#: ../../c-api/init_config.rst:663
+#: ../../c-api/init_config.rst:689
msgid ""
"``L\"always\"``: Hash the source file for invalidation regardless of value "
"of the 'check_source' flag."
msgstr ""
-#: ../../c-api/init_config.rst:665
+#: ../../c-api/init_config.rst:691
msgid "``L\"never\"``: Assume that hash-based pycs always are valid."
msgstr ""
-#: ../../c-api/init_config.rst:666
+#: ../../c-api/init_config.rst:692
msgid ""
"``L\"default\"``: The 'check_source' flag in hash-based pycs determines "
"invalidation."
msgstr ""
-#: ../../c-api/init_config.rst:669
+#: ../../c-api/init_config.rst:695
msgid "Default: ``L\"default\"``."
msgstr "預設:``L\"default\"``。"
-#: ../../c-api/init_config.rst:671
+#: ../../c-api/init_config.rst:697
msgid "See also :pep:`552` \"Deterministic pycs\"."
msgstr ""
-#: ../../c-api/init_config.rst:675
+#: ../../c-api/init_config.rst:701
msgid "If non-zero, configure C standard streams:"
msgstr ""
-#: ../../c-api/init_config.rst:677
+#: ../../c-api/init_config.rst:703
msgid ""
"On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr."
msgstr ""
-#: ../../c-api/init_config.rst:679
+#: ../../c-api/init_config.rst:705
msgid ""
"If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of "
"stdin, stdout and stderr streams."
msgstr ""
-#: ../../c-api/init_config.rst:681
+#: ../../c-api/init_config.rst:707
msgid ""
"If :c:member:`~PyConfig.interactive` is non-zero, enable stream buffering on "
"stdin and stdout (only stdout on Windows)."
msgstr ""
-#: ../../c-api/init_config.rst:688
+#: ../../c-api/init_config.rst:714
msgid "If non-zero, enable the :ref:`Python Development Mode `."
msgstr ""
-#: ../../c-api/init_config.rst:690
+#: ../../c-api/init_config.rst:716
msgid ""
"Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:"
"`PYTHONDEVMODE` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:697
+#: ../../c-api/init_config.rst:723
msgid "Dump Python references?"
msgstr ""
-#: ../../c-api/init_config.rst:699
+#: ../../c-api/init_config.rst:725
msgid "If non-zero, dump all objects which are still alive at exit."
msgstr ""
-#: ../../c-api/init_config.rst:701
+#: ../../c-api/init_config.rst:727
msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:703
+#: ../../c-api/init_config.rst:729
msgid ""
-"Need a special build of Python with the ``Py_TRACE_REFS`` macro defined: see "
-"the :option:`configure --with-trace-refs option <--with-trace-refs>`."
+"Needs a special build of Python with the ``Py_TRACE_REFS`` macro defined: "
+"see the :option:`configure --with-trace-refs option <--with-trace-refs>`."
msgstr ""
-#: ../../c-api/init_config.rst:710
+#: ../../c-api/init_config.rst:736
msgid ""
"The site-specific directory prefix where the platform-dependent Python files "
"are installed: :data:`sys.exec_prefix`."
msgstr ""
-#: ../../c-api/init_config.rst:719
+#: ../../c-api/init_config.rst:743
+msgid "See also :c:member:`PyConfig.base_exec_prefix`."
+msgstr "也請見 :c:member:`PyConfig.base_exec_prefix`"
+
+#: ../../c-api/init_config.rst:747
msgid ""
"The absolute path of the executable binary for the Python interpreter: :data:"
"`sys.executable`."
msgstr ""
-#: ../../c-api/init_config.rst:728
+#: ../../c-api/init_config.rst:754
+msgid "See also :c:member:`PyConfig.base_executable`."
+msgstr "也請見 :c:member:`PyConfig.base_executable`"
+
+#: ../../c-api/init_config.rst:758
msgid "Enable faulthandler?"
msgstr ""
-#: ../../c-api/init_config.rst:730
+#: ../../c-api/init_config.rst:760
msgid "If non-zero, call :func:`faulthandler.enable` at startup."
msgstr ""
-#: ../../c-api/init_config.rst:732
+#: ../../c-api/init_config.rst:762
msgid ""
"Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:"
"`PYTHONFAULTHANDLER` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:739
+#: ../../c-api/init_config.rst:769
msgid ""
":term:`Filesystem encoding `: :func:"
"`sys.getfilesystemencoding`."
msgstr ""
-#: ../../c-api/init_config.rst:742
+#: ../../c-api/init_config.rst:772
msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default."
msgstr ""
-#: ../../c-api/init_config.rst:744
+#: ../../c-api/init_config.rst:774
msgid ""
"On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` if :c:member:"
"`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is non-"
"zero."
msgstr ""
-#: ../../c-api/init_config.rst:748
+#: ../../c-api/init_config.rst:778
msgid "Default encoding on other platforms:"
msgstr ""
-#: ../../c-api/init_config.rst:750
+#: ../../c-api/init_config.rst:780
msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero."
msgstr ""
-#: ../../c-api/init_config.rst:751
+#: ../../c-api/init_config.rst:781
msgid ""
"``\"ascii\"`` if Python detects that ``nl_langinfo(CODESET)`` announces the "
"ASCII encoding, whereas the ``mbstowcs()`` function decodes from a different "
"encoding (usually Latin1)."
msgstr ""
-#: ../../c-api/init_config.rst:754
+#: ../../c-api/init_config.rst:784
msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string."
msgstr ""
-#: ../../c-api/init_config.rst:755
+#: ../../c-api/init_config.rst:785
msgid ""
"Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result."
msgstr ""
-#: ../../c-api/init_config.rst:758
+#: ../../c-api/init_config.rst:788
msgid ""
"At Python startup, the encoding name is normalized to the Python codec name. "
"For example, ``\"ANSI_X3.4-1968\"`` is replaced with ``\"ascii\"``."
msgstr ""
-#: ../../c-api/init_config.rst:761
+#: ../../c-api/init_config.rst:791
msgid "See also the :c:member:`~PyConfig.filesystem_errors` member."
msgstr ""
-#: ../../c-api/init_config.rst:765
+#: ../../c-api/init_config.rst:795
msgid ""
":term:`Filesystem error handler `: :"
"func:`sys.getfilesystemencodeerrors`."
msgstr ""
-#: ../../c-api/init_config.rst:768
+#: ../../c-api/init_config.rst:798
msgid ""
"On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:"
"member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is "
"non-zero."
msgstr ""
-#: ../../c-api/init_config.rst:772
+#: ../../c-api/init_config.rst:802
msgid "On other platforms: use ``\"surrogateescape\"`` by default."
msgstr ""
-#: ../../c-api/init_config.rst:774
+#: ../../c-api/init_config.rst:804
msgid "Supported error handlers:"
msgstr ""
-#: ../../c-api/init_config.rst:776
+#: ../../c-api/init_config.rst:806
msgid "``\"strict\"``"
msgstr "``\"strict\"``"
-#: ../../c-api/init_config.rst:777
+#: ../../c-api/init_config.rst:807
msgid "``\"surrogateescape\"``"
msgstr "``\"surrogateescape\"``"
-#: ../../c-api/init_config.rst:778
+#: ../../c-api/init_config.rst:808
msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)"
msgstr ""
-#: ../../c-api/init_config.rst:780
+#: ../../c-api/init_config.rst:810
msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member."
msgstr ""
-#: ../../c-api/init_config.rst:785
+#: ../../c-api/init_config.rst:815
msgid "Randomized hash function seed."
msgstr ""
-#: ../../c-api/init_config.rst:787
+#: ../../c-api/init_config.rst:817
msgid ""
"If :c:member:`~PyConfig.use_hash_seed` is zero, a seed is chosen randomly at "
"Python startup, and :c:member:`~PyConfig.hash_seed` is ignored."
msgstr ""
-#: ../../c-api/init_config.rst:790
+#: ../../c-api/init_config.rst:820
msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:792
+#: ../../c-api/init_config.rst:822
msgid ""
"Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode."
msgstr ""
-#: ../../c-api/init_config.rst:797
-msgid "Python home directory."
-msgstr ""
-
-#: ../../c-api/init_config.rst:799
+#: ../../c-api/init_config.rst:827
msgid ""
-"If :c:func:`Py_SetPythonHome` has been called, use its argument if it is not "
-"``NULL``."
+"Set the default Python \"home\" directory, that is, the location of the "
+"standard Python libraries (see :envvar:`PYTHONHOME`)."
msgstr ""
-#: ../../c-api/init_config.rst:802
+#: ../../c-api/init_config.rst:830
msgid "Set by the :envvar:`PYTHONHOME` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:806 ../../c-api/init_config.rst:923
-#: ../../c-api/init_config.rst:943 ../../c-api/init_config.rst:1032
-#: ../../c-api/init_config.rst:1062
+#: ../../c-api/init_config.rst:834 ../../c-api/init_config.rst:964
+#: ../../c-api/init_config.rst:984 ../../c-api/init_config.rst:1073
+#: ../../c-api/init_config.rst:1104
msgid "Part of the :ref:`Python Path Configuration ` input."
msgstr ""
-#: ../../c-api/init_config.rst:810
+#: ../../c-api/init_config.rst:838
msgid "If non-zero, profile import time."
msgstr ""
-#: ../../c-api/init_config.rst:812
+#: ../../c-api/init_config.rst:840
msgid ""
"Set the ``1`` by the :option:`-X importtime <-X>` option and the :envvar:"
"`PYTHONPROFILEIMPORTTIME` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:819
+#: ../../c-api/init_config.rst:847
msgid "Enter interactive mode after executing a script or a command."
msgstr ""
-#: ../../c-api/init_config.rst:821
+#: ../../c-api/init_config.rst:849
msgid ""
"If greater than ``0``, enable inspect: when a script is passed as first "
"argument or the -c option is used, enter interactive mode after executing "
@@ -1162,30 +1204,30 @@ msgid ""
"a terminal."
msgstr ""
-#: ../../c-api/init_config.rst:826
+#: ../../c-api/init_config.rst:854
msgid ""
"Incremented by the :option:`-i` command line option. Set to ``1`` if the :"
"envvar:`PYTHONINSPECT` environment variable is non-empty."
msgstr ""
-#: ../../c-api/init_config.rst:833
+#: ../../c-api/init_config.rst:861
msgid "Install Python signal handlers?"
msgstr ""
-#: ../../c-api/init_config.rst:835 ../../c-api/init_config.rst:1006
-#: ../../c-api/init_config.rst:1030 ../../c-api/init_config.rst:1223
+#: ../../c-api/init_config.rst:863 ../../c-api/init_config.rst:1047
+#: ../../c-api/init_config.rst:1071 ../../c-api/init_config.rst:1282
msgid "Default: ``1`` in Python mode, ``0`` in isolated mode."
msgstr ""
-#: ../../c-api/init_config.rst:839
+#: ../../c-api/init_config.rst:867
msgid "If greater than ``0``, enable the interactive mode (REPL)."
msgstr ""
-#: ../../c-api/init_config.rst:841
+#: ../../c-api/init_config.rst:869
msgid "Incremented by the :option:`-i` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:847
+#: ../../c-api/init_config.rst:875
msgid ""
"Configures the :ref:`integer string conversion length limitation "
"`. An initial value of ``-1`` means the value will be "
@@ -1195,30 +1237,47 @@ msgid ""
"str_digits_check_threshold`) are unsupported and will produce an error."
msgstr ""
-#: ../../c-api/init_config.rst:855
+#: ../../c-api/init_config.rst:883
msgid ""
"Configured by the :option:`-X int_max_str_digits <-X>` command line flag or "
"the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:858
+#: ../../c-api/init_config.rst:886
msgid ""
"Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info."
"default_max_str_digits`) in isolated mode."
msgstr ""
-#: ../../c-api/init_config.rst:865
+#: ../../c-api/init_config.rst:893
+msgid ""
+"If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will "
+"override the return values of :func:`os.cpu_count`, :func:`os."
+"process_cpu_count`, and :func:`multiprocessing.cpu_count`."
+msgstr ""
+
+#: ../../c-api/init_config.rst:897
+msgid ""
+"Configured by the :samp:`-X cpu_count={n|default}` command line flag or the :"
+"envvar:`PYTHON_CPU_COUNT` environment variable."
+msgstr ""
+
+#: ../../c-api/init_config.rst:900 ../../c-api/init_config.rst:1259
+msgid "Default: ``-1``."
+msgstr "預設值:``1``。"
+
+#: ../../c-api/init_config.rst:906
msgid "If greater than ``0``, enable isolated mode:"
msgstr ""
-#: ../../c-api/init_config.rst:867
+#: ../../c-api/init_config.rst:908
msgid ""
"Set :c:member:`~PyConfig.safe_path` to ``1``: don't prepend a potentially "
"unsafe path to :data:`sys.path` at Python startup, such as the current "
"directory, the script's directory or an empty string."
msgstr ""
-#: ../../c-api/init_config.rst:871
+#: ../../c-api/init_config.rst:912
msgid ""
"Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` "
"environment variables."
@@ -1226,77 +1285,77 @@ msgstr ""
"將 :c:member:`~PyConfig.use_environment` 設定為 ``0``:忽略 ``PYTHON`` 環境變"
"數。"
-#: ../../c-api/init_config.rst:873
+#: ../../c-api/init_config.rst:914
msgid ""
"Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user "
"site directory to :data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:875
+#: ../../c-api/init_config.rst:916
msgid ""
"Python REPL doesn't import :mod:`readline` nor enable default readline "
"configuration on interactive prompts."
msgstr ""
-#: ../../c-api/init_config.rst:878
+#: ../../c-api/init_config.rst:919
msgid "Set to ``1`` by the :option:`-I` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:882
+#: ../../c-api/init_config.rst:923
msgid ""
"See also the :ref:`Isolated Configuration ` and :c:"
"member:`PyPreConfig.isolated`."
msgstr ""
-#: ../../c-api/init_config.rst:887
+#: ../../c-api/init_config.rst:928
msgid ""
"If non-zero, use :class:`io.FileIO` instead of :class:`!io."
"_WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys."
"stderr`."
msgstr ""
-#: ../../c-api/init_config.rst:891
+#: ../../c-api/init_config.rst:932
msgid ""
"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable "
"is set to a non-empty string."
msgstr ""
-#: ../../c-api/init_config.rst:899
+#: ../../c-api/init_config.rst:940
msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)."
msgstr ""
-#: ../../c-api/init_config.rst:903
+#: ../../c-api/init_config.rst:944
msgid ""
"If non-zero, dump statistics on :ref:`Python pymalloc memory allocator "
"` at exit."
msgstr ""
-#: ../../c-api/init_config.rst:906
+#: ../../c-api/init_config.rst:947
msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:908
+#: ../../c-api/init_config.rst:949
msgid ""
"The option is ignored if Python is :option:`configured using the --without-"
"pymalloc option <--without-pymalloc>`."
msgstr ""
-#: ../../c-api/init_config.rst:915
+#: ../../c-api/init_config.rst:956
msgid "Platform library directory name: :data:`sys.platlibdir`."
msgstr ""
-#: ../../c-api/init_config.rst:917
+#: ../../c-api/init_config.rst:958
msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:919
+#: ../../c-api/init_config.rst:960
msgid ""
"Default: value of the ``PLATLIBDIR`` macro which is set by the :option:"
"`configure --with-platlibdir option <--with-platlibdir>` (default: "
"``\"lib\"``, or ``\"DLLs\"`` on Windows)."
msgstr ""
-#: ../../c-api/init_config.rst:927
+#: ../../c-api/init_config.rst:968
msgid ""
"This macro is now used on Windows to locate the standard library extension "
"modules, typically under ``DLLs``. However, for compatibility, note that "
@@ -1304,21 +1363,21 @@ msgid ""
"and virtual environments."
msgstr ""
-#: ../../c-api/init_config.rst:936
+#: ../../c-api/init_config.rst:977
msgid ""
"Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:"
"data:`os.pathsep`)."
msgstr ""
-#: ../../c-api/init_config.rst:939
+#: ../../c-api/init_config.rst:980
msgid "Set by the :envvar:`PYTHONPATH` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:948
+#: ../../c-api/init_config.rst:989
msgid "Module search paths: :data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:950
+#: ../../c-api/init_config.rst:991
msgid ""
"If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:"
"`Py_InitializeFromConfig` will replace :c:member:`~PyConfig."
@@ -1326,41 +1385,41 @@ msgid ""
"to ``1``."
msgstr ""
-#: ../../c-api/init_config.rst:955
+#: ../../c-api/init_config.rst:996
msgid ""
"Default: empty list (``module_search_paths``) and ``0`` "
"(``module_search_paths_set``)."
msgstr ""
-#: ../../c-api/init_config.rst:962
+#: ../../c-api/init_config.rst:1003
msgid "Compilation optimization level:"
msgstr ""
-#: ../../c-api/init_config.rst:964
+#: ../../c-api/init_config.rst:1005
msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``."
msgstr ""
-#: ../../c-api/init_config.rst:965
+#: ../../c-api/init_config.rst:1006
msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``."
msgstr ""
-#: ../../c-api/init_config.rst:966
+#: ../../c-api/init_config.rst:1007
msgid "``2``: Level 1, strip docstrings."
msgstr ""
-#: ../../c-api/init_config.rst:968
+#: ../../c-api/init_config.rst:1009
msgid ""
"Incremented by the :option:`-O` command line option. Set to the :envvar:"
"`PYTHONOPTIMIZE` environment variable value."
msgstr ""
-#: ../../c-api/init_config.rst:975
+#: ../../c-api/init_config.rst:1016
msgid ""
"The list of the original command line arguments passed to the Python "
"executable: :data:`sys.orig_argv`."
msgstr ""
-#: ../../c-api/init_config.rst:978
+#: ../../c-api/init_config.rst:1019
msgid ""
"If :c:member:`~PyConfig.orig_argv` list is empty and :c:member:`~PyConfig."
"argv` is not a list only containing an empty string, :c:func:`PyConfig_Read` "
@@ -1369,388 +1428,400 @@ msgid ""
"parse_argv` is non-zero)."
msgstr ""
-#: ../../c-api/init_config.rst:985
+#: ../../c-api/init_config.rst:1026
msgid ""
"See also the :c:member:`~PyConfig.argv` member and the :c:func:"
"`Py_GetArgcArgv` function."
msgstr ""
-#: ../../c-api/init_config.rst:988 ../../c-api/init_config.rst:1258
-#: ../../c-api/init_config.rst:1277
+#: ../../c-api/init_config.rst:1029 ../../c-api/init_config.rst:1317
+#: ../../c-api/init_config.rst:1336
msgid "Default: empty list."
msgstr ""
-#: ../../c-api/init_config.rst:994
+#: ../../c-api/init_config.rst:1035
msgid "Parse command line arguments?"
msgstr ""
-#: ../../c-api/init_config.rst:996
+#: ../../c-api/init_config.rst:1037
msgid ""
"If equals to ``1``, parse :c:member:`~PyConfig.argv` the same way the "
"regular Python parses :ref:`command line arguments `, and "
"strip Python arguments from :c:member:`~PyConfig.argv`."
msgstr ""
-#: ../../c-api/init_config.rst:1008
+#: ../../c-api/init_config.rst:1049
msgid ""
"The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:"
"`PyConfig.parse_argv` equals to ``1``."
msgstr ""
-#: ../../c-api/init_config.rst:1014
+#: ../../c-api/init_config.rst:1055
msgid ""
"Parser debug mode. If greater than ``0``, turn on parser debugging output "
"(for expert only, depending on compilation options)."
msgstr ""
-#: ../../c-api/init_config.rst:1017
+#: ../../c-api/init_config.rst:1058
msgid ""
"Incremented by the :option:`-d` command line option. Set to the :envvar:"
"`PYTHONDEBUG` environment variable value."
msgstr ""
-#: ../../c-api/init_config.rst:1020
+#: ../../c-api/init_config.rst:1061 ../../c-api/init_config.rst:1166
msgid ""
-"Need a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro "
+"Needs a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro "
"must be defined)."
msgstr ""
-#: ../../c-api/init_config.rst:1027
+#: ../../c-api/init_config.rst:1068
msgid ""
"If non-zero, calculation of path configuration is allowed to log warnings "
"into ``stderr``. If equals to ``0``, suppress these warnings."
msgstr ""
-#: ../../c-api/init_config.rst:1034
+#: ../../c-api/init_config.rst:1075
msgid "Now also applies on Windows."
msgstr ""
-#: ../../c-api/init_config.rst:1039
+#: ../../c-api/init_config.rst:1080
msgid ""
"The site-specific directory prefix where the platform independent Python "
"files are installed: :data:`sys.prefix`."
msgstr ""
-#: ../../c-api/init_config.rst:1048
+#: ../../c-api/init_config.rst:1087
+msgid "See also :c:member:`PyConfig.base_prefix`."
+msgstr "也請見 :c:member:`PyConfig.base_prefix`"
+
+#: ../../c-api/init_config.rst:1091
msgid ""
"Program name used to initialize :c:member:`~PyConfig.executable` and in "
"early error messages during Python initialization."
msgstr ""
-#: ../../c-api/init_config.rst:1051
-msgid "If :func:`Py_SetProgramName` has been called, use its argument."
-msgstr ""
-
-#: ../../c-api/init_config.rst:1052
+#: ../../c-api/init_config.rst:1094
msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set."
msgstr ""
-#: ../../c-api/init_config.rst:1053
+#: ../../c-api/init_config.rst:1095
msgid ""
"If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:"
"`__PYVENV_LAUNCHER__` environment variable if set."
msgstr ""
-#: ../../c-api/init_config.rst:1055
+#: ../../c-api/init_config.rst:1097
msgid ""
"Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty."
msgstr ""
-#: ../../c-api/init_config.rst:1057
+#: ../../c-api/init_config.rst:1099
msgid ""
"Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other "
"platforms."
msgstr ""
-#: ../../c-api/init_config.rst:1066
+#: ../../c-api/init_config.rst:1108
msgid ""
"Directory where cached ``.pyc`` files are written: :data:`sys."
"pycache_prefix`."
msgstr ""
-#: ../../c-api/init_config.rst:1069
+#: ../../c-api/init_config.rst:1111
msgid ""
"Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and "
-"the :envvar:`PYTHONPYCACHEPREFIX` environment variable."
+"the :envvar:`PYTHONPYCACHEPREFIX` environment variable. The command-line "
+"option takes precedence."
msgstr ""
-#: ../../c-api/init_config.rst:1072
+#: ../../c-api/init_config.rst:1115
msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``."
msgstr ""
-#: ../../c-api/init_config.rst:1078
+#: ../../c-api/init_config.rst:1121
msgid ""
"Quiet mode. If greater than ``0``, don't display the copyright and version "
"at Python startup in interactive mode."
msgstr ""
-#: ../../c-api/init_config.rst:1081
+#: ../../c-api/init_config.rst:1124
msgid "Incremented by the :option:`-q` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:1087
+#: ../../c-api/init_config.rst:1130
msgid "Value of the :option:`-c` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:1089 ../../c-api/init_config.rst:1110
+#: ../../c-api/init_config.rst:1132 ../../c-api/init_config.rst:1153
msgid "Used by :c:func:`Py_RunMain`."
msgstr ""
-#: ../../c-api/init_config.rst:1095
+#: ../../c-api/init_config.rst:1138
msgid ""
"Filename passed on the command line: trailing command line argument without :"
"option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function."
msgstr ""
-#: ../../c-api/init_config.rst:1099
+#: ../../c-api/init_config.rst:1142
msgid ""
"For example, it is set to ``script.py`` by the ``python3 script.py arg`` "
"command line."
msgstr ""
-#: ../../c-api/init_config.rst:1102
+#: ../../c-api/init_config.rst:1145
msgid "See also the :c:member:`PyConfig.skip_source_first_line` option."
msgstr "也請見 :c:member:`PyConfig.skip_source_first_line` 選項。"
-#: ../../c-api/init_config.rst:1108
+#: ../../c-api/init_config.rst:1151
msgid "Value of the :option:`-m` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:1116
-msgid "Show total reference count at exit (excluding immortal objects)?"
+#: ../../c-api/init_config.rst:1159
+msgid ""
+"``package.module`` path to module that should be imported before ``site.py`` "
+"is run."
+msgstr ""
+
+#: ../../c-api/init_config.rst:1162
+msgid ""
+"Set by the :option:`-X presite=package.module <-X>` command-line option and "
+"the :envvar:`PYTHON_PRESITE` environment variable. The command-line option "
+"takes precedence."
msgstr ""
-#: ../../c-api/init_config.rst:1118
+#: ../../c-api/init_config.rst:1173
+msgid ""
+"Show total reference count at exit (excluding :term:`immortal` objects)?"
+msgstr ""
+
+#: ../../c-api/init_config.rst:1175
msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:1120
+#: ../../c-api/init_config.rst:1177
msgid ""
-"Need a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` "
+"Needs a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` "
"macro must be defined)."
msgstr ""
-#: ../../c-api/init_config.rst:1127
+#: ../../c-api/init_config.rst:1184
msgid "Import the :mod:`site` module at startup?"
msgstr ""
-#: ../../c-api/init_config.rst:1129
+#: ../../c-api/init_config.rst:1186
msgid ""
"If equal to zero, disable the import of the module site and the site-"
"dependent manipulations of :data:`sys.path` that it entails."
msgstr ""
-#: ../../c-api/init_config.rst:1132
+#: ../../c-api/init_config.rst:1189
msgid ""
"Also disable these manipulations if the :mod:`site` module is explicitly "
"imported later (call :func:`site.main` if you want them to be triggered)."
msgstr ""
-#: ../../c-api/init_config.rst:1135
+#: ../../c-api/init_config.rst:1192
msgid "Set to ``0`` by the :option:`-S` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:1137
+#: ../../c-api/init_config.rst:1194
msgid ""
":data:`sys.flags.no_site ` is set to the inverted value of :c:"
"member:`~PyConfig.site_import`."
msgstr ""
-#: ../../c-api/init_config.rst:1144
+#: ../../c-api/init_config.rst:1201
msgid ""
"If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` "
"source."
msgstr ""
-#: ../../c-api/init_config.rst:1147
+#: ../../c-api/init_config.rst:1204
msgid ""
"It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a "
"DOS specific hack only."
msgstr ""
-#: ../../c-api/init_config.rst:1150
+#: ../../c-api/init_config.rst:1207
msgid "Set to ``1`` by the :option:`-x` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:1157
+#: ../../c-api/init_config.rst:1214
msgid ""
"Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :"
"data:`sys.stderr` (but :data:`sys.stderr` always uses "
"``\"backslashreplace\"`` error handler)."
msgstr ""
-#: ../../c-api/init_config.rst:1161
-msgid ""
-"If :c:func:`Py_SetStandardStreamEncoding` has been called, use its *error* "
-"and *errors* arguments if they are not ``NULL``."
-msgstr ""
-
-#: ../../c-api/init_config.rst:1164
+#: ../../c-api/init_config.rst:1218
msgid ""
"Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty."
msgstr ""
-#: ../../c-api/init_config.rst:1167
+#: ../../c-api/init_config.rst:1221
msgid "Default encoding:"
msgstr ""
-#: ../../c-api/init_config.rst:1169
+#: ../../c-api/init_config.rst:1223
msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero."
msgstr ""
-#: ../../c-api/init_config.rst:1170
+#: ../../c-api/init_config.rst:1224
msgid "Otherwise, use the :term:`locale encoding`."
msgstr ""
-#: ../../c-api/init_config.rst:1172
+#: ../../c-api/init_config.rst:1226
msgid "Default error handler:"
msgstr ""
-#: ../../c-api/init_config.rst:1174
+#: ../../c-api/init_config.rst:1228
msgid "On Windows: use ``\"surrogateescape\"``."
msgstr ""
-#: ../../c-api/init_config.rst:1175
+#: ../../c-api/init_config.rst:1229
msgid ""
"``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or "
"if the LC_CTYPE locale is \"C\" or \"POSIX\"."
msgstr ""
-#: ../../c-api/init_config.rst:1177
+#: ../../c-api/init_config.rst:1231
msgid "``\"strict\"`` otherwise."
msgstr ""
-#: ../../c-api/init_config.rst:1181
+#: ../../c-api/init_config.rst:1233
+msgid "See also :c:member:`PyConfig.legacy_windows_stdio`."
+msgstr "也請見 :c:member:`PyConfig.legacy_windows_stdio`。"
+
+#: ../../c-api/init_config.rst:1237
msgid "Enable tracemalloc?"
msgstr ""
-#: ../../c-api/init_config.rst:1183
+#: ../../c-api/init_config.rst:1239
msgid "If non-zero, call :func:`tracemalloc.start` at startup."
msgstr ""
-#: ../../c-api/init_config.rst:1185
+#: ../../c-api/init_config.rst:1241
msgid ""
"Set by :option:`-X tracemalloc=N <-X>` command line option and by the :"
"envvar:`PYTHONTRACEMALLOC` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:1192
+#: ../../c-api/init_config.rst:1248
msgid "Enable compatibility mode with the perf profiler?"
msgstr ""
-#: ../../c-api/init_config.rst:1194
+#: ../../c-api/init_config.rst:1250
msgid ""
"If non-zero, initialize the perf trampoline. See :ref:`perf_profiling` for "
"more information."
msgstr ""
-#: ../../c-api/init_config.rst:1197
+#: ../../c-api/init_config.rst:1253
msgid ""
-"Set by :option:`-X perf <-X>` command line option and by the :envvar:"
-"`PYTHONPERFSUPPORT` environment variable."
+"Set by :option:`-X perf <-X>` command-line option and by the :envvar:"
+"`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support with stack "
+"pointers and :option:`-X perf_jit <-X>` command-line option and by the :"
+"envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support with "
+"DWARF JIT information."
msgstr ""
-#: ../../c-api/init_config.rst:1200
-msgid "Default: ``-1``."
-msgstr "預設值:``1``。"
-
-#: ../../c-api/init_config.rst:1206
+#: ../../c-api/init_config.rst:1265
msgid "Use :ref:`environment variables `?"
msgstr ""
-#: ../../c-api/init_config.rst:1208
+#: ../../c-api/init_config.rst:1267
msgid ""
"If equals to zero, ignore the :ref:`environment variables `."
msgstr ""
-#: ../../c-api/init_config.rst:1211
+#: ../../c-api/init_config.rst:1270
msgid "Set to ``0`` by the :option:`-E` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:1217
+#: ../../c-api/init_config.rst:1276
msgid "If non-zero, add the user site directory to :data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:1219
+#: ../../c-api/init_config.rst:1278
msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options."
msgstr ""
-#: ../../c-api/init_config.rst:1221
+#: ../../c-api/init_config.rst:1280
msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:1227
+#: ../../c-api/init_config.rst:1286
msgid ""
"Verbose mode. If greater than ``0``, print a message each time a module is "
"imported, showing the place (filename or built-in module) from which it is "
"loaded."
msgstr ""
-#: ../../c-api/init_config.rst:1231
+#: ../../c-api/init_config.rst:1290
msgid ""
"If greater than or equal to ``2``, print a message for each file that is "
"checked for when searching for a module. Also provides information on module "
"cleanup at exit."
msgstr ""
-#: ../../c-api/init_config.rst:1235
+#: ../../c-api/init_config.rst:1294
msgid "Incremented by the :option:`-v` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:1237
+#: ../../c-api/init_config.rst:1296
msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value."
msgstr ""
-#: ../../c-api/init_config.rst:1243
+#: ../../c-api/init_config.rst:1302
msgid ""
"Options of the :mod:`warnings` module to build warnings filters, lowest to "
"highest priority: :data:`sys.warnoptions`."
msgstr ""
-#: ../../c-api/init_config.rst:1246
+#: ../../c-api/init_config.rst:1305
msgid ""
"The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse "
"order: the last :c:member:`PyConfig.warnoptions` item becomes the first item "
"of :data:`warnings.filters` which is checked first (highest priority)."
msgstr ""
-#: ../../c-api/init_config.rst:1251
+#: ../../c-api/init_config.rst:1310
msgid ""
"The :option:`-W` command line options adds its value to :c:member:`~PyConfig."
"warnoptions`, it can be used multiple times."
msgstr ""
-#: ../../c-api/init_config.rst:1254
+#: ../../c-api/init_config.rst:1313
msgid ""
"The :envvar:`PYTHONWARNINGS` environment variable can also be used to add "
"warning options. Multiple options can be specified, separated by commas (``,"
"``)."
msgstr ""
-#: ../../c-api/init_config.rst:1262
+#: ../../c-api/init_config.rst:1321
msgid ""
"If equal to ``0``, Python won't try to write ``.pyc`` files on the import of "
"source modules."
msgstr ""
-#: ../../c-api/init_config.rst:1265
+#: ../../c-api/init_config.rst:1324
msgid ""
"Set to ``0`` by the :option:`-B` command line option and the :envvar:"
"`PYTHONDONTWRITEBYTECODE` environment variable."
msgstr ""
-#: ../../c-api/init_config.rst:1268
+#: ../../c-api/init_config.rst:1327
msgid ""
":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:"
"member:`~PyConfig.write_bytecode`."
msgstr ""
-#: ../../c-api/init_config.rst:1275
+#: ../../c-api/init_config.rst:1334
msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`."
msgstr ""
-#: ../../c-api/init_config.rst:1279
+#: ../../c-api/init_config.rst:1338
msgid ""
"If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` "
"arguments are parsed the same way the regular Python parses :ref:`command "
@@ -1758,29 +1829,27 @@ msgid ""
"c:member:`~PyConfig.argv`."
msgstr ""
-#: ../../c-api/init_config.rst:1284
+#: ../../c-api/init_config.rst:1343
msgid ""
"The :c:member:`~PyConfig.xoptions` options are parsed to set other options: "
"see the :option:`-X` command line option."
msgstr ""
-#: ../../c-api/init_config.rst:1289
+#: ../../c-api/init_config.rst:1348
msgid "The ``show_alloc_count`` field has been removed."
msgstr ""
-#: ../../c-api/init_config.rst:1293
+#: ../../c-api/init_config.rst:1354
msgid "Initialization with PyConfig"
msgstr ""
-#: ../../c-api/init_config.rst:1295
-msgid "Function to initialize Python:"
-msgstr ""
-
-#: ../../c-api/init_config.rst:1299
-msgid "Initialize Python from *config* configuration."
+#: ../../c-api/init_config.rst:1356
+msgid ""
+"Initializing the interpreter from a populated configuration struct is "
+"handled by calling :c:func:`Py_InitializeFromConfig`."
msgstr ""
-#: ../../c-api/init_config.rst:1304
+#: ../../c-api/init_config.rst:1362
msgid ""
"If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:"
"func:`PyImport_ExtendInittab` are used, they must be set or called after "
@@ -1789,17 +1858,17 @@ msgid ""
"`PyImport_ExtendInittab` must be called before each Python initialization."
msgstr ""
-#: ../../c-api/init_config.rst:1311
+#: ../../c-api/init_config.rst:1369
msgid ""
"The current configuration (``PyConfig`` type) is stored in "
"``PyInterpreterState.config``."
msgstr ""
-#: ../../c-api/init_config.rst:1314
+#: ../../c-api/init_config.rst:1372
msgid "Example setting the program name::"
msgstr ""
-#: ../../c-api/init_config.rst:1316
+#: ../../c-api/init_config.rst:1374
msgid ""
"void init_python(void)\n"
"{\n"
@@ -1853,7 +1922,7 @@ msgstr ""
" Py_ExitStatusException(status);\n"
"}"
-#: ../../c-api/init_config.rst:1342
+#: ../../c-api/init_config.rst:1400
msgid ""
"More complete example modifying the default configuration, read the "
"configuration, and then override some parameters. Note that since 3.11, many "
@@ -1862,7 +1931,7 @@ msgid ""
"called will be left unchanged by initialization::"
msgstr ""
-#: ../../c-api/init_config.rst:1349
+#: ../../c-api/init_config.rst:1407
msgid ""
"PyStatus init_python(const char *program_name)\n"
"{\n"
@@ -1917,18 +1986,18 @@ msgid ""
"}"
msgstr ""
-#: ../../c-api/init_config.rst:1405
+#: ../../c-api/init_config.rst:1463
msgid "Isolated Configuration"
msgstr ""
-#: ../../c-api/init_config.rst:1407
+#: ../../c-api/init_config.rst:1465
msgid ""
":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:"
"`PyConfig_InitIsolatedConfig` functions create a configuration to isolate "
"Python from the system. For example, to embed Python into an application."
msgstr ""
-#: ../../c-api/init_config.rst:1412
+#: ../../c-api/init_config.rst:1470
msgid ""
"This configuration ignores global configuration variables, environment "
"variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) "
@@ -1936,115 +2005,115 @@ msgid ""
"LC_CTYPE locale are left unchanged. Signal handlers are not installed."
msgstr ""
-#: ../../c-api/init_config.rst:1417
+#: ../../c-api/init_config.rst:1475
msgid ""
"Configuration files are still used with this configuration to determine "
"paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to "
"avoid computing the default path configuration."
msgstr ""
-#: ../../c-api/init_config.rst:1425
+#: ../../c-api/init_config.rst:1483
msgid "Python Configuration"
msgstr ""
-#: ../../c-api/init_config.rst:1427
+#: ../../c-api/init_config.rst:1485
msgid ""
":c:func:`PyPreConfig_InitPythonConfig` and :c:func:"
"`PyConfig_InitPythonConfig` functions create a configuration to build a "
"customized Python which behaves as the regular Python."
msgstr ""
-#: ../../c-api/init_config.rst:1431
+#: ../../c-api/init_config.rst:1489
msgid ""
"Environments variables and command line arguments are used to configure "
"Python, whereas global configuration variables are ignored."
msgstr ""
-#: ../../c-api/init_config.rst:1434
+#: ../../c-api/init_config.rst:1492
msgid ""
"This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 "
"Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:"
"`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables."
msgstr ""
-#: ../../c-api/init_config.rst:1443
+#: ../../c-api/init_config.rst:1501
msgid "Python Path Configuration"
msgstr ""
-#: ../../c-api/init_config.rst:1445
+#: ../../c-api/init_config.rst:1503
msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:"
msgstr ""
-#: ../../c-api/init_config.rst:1447
+#: ../../c-api/init_config.rst:1505
msgid "Path configuration inputs:"
msgstr ""
-#: ../../c-api/init_config.rst:1449
+#: ../../c-api/init_config.rst:1507
msgid ":c:member:`PyConfig.home`"
msgstr ":c:member:`PyConfig.home`"
-#: ../../c-api/init_config.rst:1450
+#: ../../c-api/init_config.rst:1508
msgid ":c:member:`PyConfig.platlibdir`"
msgstr ":c:member:`PyConfig.platlibdir`"
-#: ../../c-api/init_config.rst:1451
+#: ../../c-api/init_config.rst:1509
msgid ":c:member:`PyConfig.pathconfig_warnings`"
msgstr ":c:member:`PyConfig.pathconfig_warnings`"
-#: ../../c-api/init_config.rst:1452
+#: ../../c-api/init_config.rst:1510
msgid ":c:member:`PyConfig.program_name`"
msgstr ":c:member:`PyConfig.program_name`"
-#: ../../c-api/init_config.rst:1453
+#: ../../c-api/init_config.rst:1511
msgid ":c:member:`PyConfig.pythonpath_env`"
msgstr ":c:member:`PyConfig.pythonpath_env`"
-#: ../../c-api/init_config.rst:1454
+#: ../../c-api/init_config.rst:1512
msgid "current working directory: to get absolute paths"
msgstr ""
-#: ../../c-api/init_config.rst:1455
+#: ../../c-api/init_config.rst:1513
msgid ""
"``PATH`` environment variable to get the program full path (from :c:member:"
"`PyConfig.program_name`)"
msgstr ""
-#: ../../c-api/init_config.rst:1457
+#: ../../c-api/init_config.rst:1515
msgid "``__PYVENV_LAUNCHER__`` environment variable"
msgstr "``__PYVENV_LAUNCHER__`` 環境變數"
-#: ../../c-api/init_config.rst:1458
+#: ../../c-api/init_config.rst:1516
msgid ""
"(Windows only) Application paths in the registry under "
"\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and "
"HKEY_LOCAL_MACHINE (where X.Y is the Python version)."
msgstr ""
-#: ../../c-api/init_config.rst:1462
+#: ../../c-api/init_config.rst:1520
msgid "Path configuration output fields:"
msgstr ""
-#: ../../c-api/init_config.rst:1464
+#: ../../c-api/init_config.rst:1522
msgid ":c:member:`PyConfig.base_exec_prefix`"
msgstr ":c:member:`PyConfig.base_exec_prefix`"
-#: ../../c-api/init_config.rst:1465
+#: ../../c-api/init_config.rst:1523
msgid ":c:member:`PyConfig.base_executable`"
msgstr ":c:member:`PyConfig.base_executable`"
-#: ../../c-api/init_config.rst:1466
+#: ../../c-api/init_config.rst:1524
msgid ":c:member:`PyConfig.base_prefix`"
msgstr ":c:member:`PyConfig.base_prefix`"
-#: ../../c-api/init_config.rst:1467
+#: ../../c-api/init_config.rst:1525
msgid ":c:member:`PyConfig.exec_prefix`"
msgstr ":c:member:`PyConfig.exec_prefix`"
-#: ../../c-api/init_config.rst:1468
+#: ../../c-api/init_config.rst:1526
msgid ":c:member:`PyConfig.executable`"
msgstr ":c:member:`PyConfig.executable`"
-#: ../../c-api/init_config.rst:1469
+#: ../../c-api/init_config.rst:1527
msgid ""
":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig."
"module_search_paths`"
@@ -2052,11 +2121,11 @@ msgstr ""
":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig."
"module_search_paths`"
-#: ../../c-api/init_config.rst:1471
+#: ../../c-api/init_config.rst:1529
msgid ":c:member:`PyConfig.prefix`"
msgstr ":c:member:`PyConfig.prefix`"
-#: ../../c-api/init_config.rst:1473
+#: ../../c-api/init_config.rst:1531
msgid ""
"If at least one \"output field\" is not set, Python calculates the path "
"configuration to fill unset fields. If :c:member:`~PyConfig."
@@ -2065,7 +2134,7 @@ msgid ""
"module_search_paths_set` is set to ``1``."
msgstr ""
-#: ../../c-api/init_config.rst:1479
+#: ../../c-api/init_config.rst:1537
msgid ""
"It is possible to completely ignore the function calculating the default "
"path configuration by setting explicitly all path configuration output "
@@ -2075,52 +2144,52 @@ msgid ""
"modification."
msgstr ""
-#: ../../c-api/init_config.rst:1486
+#: ../../c-api/init_config.rst:1544
msgid ""
"Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings "
"when calculating the path configuration (Unix only, Windows does not log any "
"warning)."
msgstr ""
-#: ../../c-api/init_config.rst:1489
+#: ../../c-api/init_config.rst:1547
msgid ""
"If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig."
"base_exec_prefix` fields are not set, they inherit their value from :c:"
"member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively."
msgstr ""
-#: ../../c-api/init_config.rst:1493
+#: ../../c-api/init_config.rst:1551
msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:"
msgstr ""
-#: ../../c-api/init_config.rst:1495
+#: ../../c-api/init_config.rst:1553
msgid ""
"If :c:member:`~PyConfig.run_filename` is set and is a directory which "
"contains a ``__main__.py`` script, prepend :c:member:`~PyConfig."
"run_filename` to :data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:1498
+#: ../../c-api/init_config.rst:1556
msgid "If :c:member:`~PyConfig.isolated` is zero:"
-msgstr ""
+msgstr "如果 :c:member:`~PyConfig.isolated` 為零:"
-#: ../../c-api/init_config.rst:1500
+#: ../../c-api/init_config.rst:1558
msgid ""
"If :c:member:`~PyConfig.run_module` is set, prepend the current directory "
"to :data:`sys.path`. Do nothing if the current directory cannot be read."
msgstr ""
-#: ../../c-api/init_config.rst:1502
+#: ../../c-api/init_config.rst:1560
msgid ""
"If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the "
"filename to :data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:1504
+#: ../../c-api/init_config.rst:1562
msgid "Otherwise, prepend an empty string to :data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:1506
+#: ../../c-api/init_config.rst:1564
msgid ""
"If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be "
"modified by the :mod:`site` module. If :c:member:`~PyConfig."
@@ -2129,170 +2198,143 @@ msgid ""
"data:`sys.path`."
msgstr ""
-#: ../../c-api/init_config.rst:1512
+#: ../../c-api/init_config.rst:1570
msgid "The following configuration files are used by the path configuration:"
msgstr ""
-#: ../../c-api/init_config.rst:1514
+#: ../../c-api/init_config.rst:1572
msgid "``pyvenv.cfg``"
msgstr "``pyvenv.cfg``"
-#: ../../c-api/init_config.rst:1515
+#: ../../c-api/init_config.rst:1573
msgid "``._pth`` file (ex: ``python._pth``)"
msgstr ""
-#: ../../c-api/init_config.rst:1516
+#: ../../c-api/init_config.rst:1574
msgid "``pybuilddir.txt`` (Unix only)"
-msgstr ""
+msgstr "``pybuilddir.txt``\\ (僅限 Unix)"
-#: ../../c-api/init_config.rst:1518
+#: ../../c-api/init_config.rst:1576
msgid "If a ``._pth`` file is present:"
msgstr ""
-#: ../../c-api/init_config.rst:1520
+#: ../../c-api/init_config.rst:1578
msgid "Set :c:member:`~PyConfig.isolated` to ``1``."
msgstr "將 :c:member:`~PyConfig.isolated` 設定為 ``1``。"
-#: ../../c-api/init_config.rst:1521
+#: ../../c-api/init_config.rst:1579
msgid "Set :c:member:`~PyConfig.use_environment` to ``0``."
msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。"
-#: ../../c-api/init_config.rst:1522
+#: ../../c-api/init_config.rst:1580
msgid "Set :c:member:`~PyConfig.site_import` to ``0``."
msgstr "將 :c:member:`~PyConfig.site_import` 設定為 ``0``。"
-#: ../../c-api/init_config.rst:1523
+#: ../../c-api/init_config.rst:1581
msgid "Set :c:member:`~PyConfig.safe_path` to ``1``."
msgstr "將 :c:member:`~PyConfig.safe_path` 設定為 ``1``。"
-#: ../../c-api/init_config.rst:1525
+#: ../../c-api/init_config.rst:1583
msgid ""
"The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:"
-"`PyConfig.base_executable`"
-msgstr ""
-
-#: ../../c-api/init_config.rst:1530
-msgid "Py_RunMain()"
-msgstr "Py_RunMain()"
-
-#: ../../c-api/init_config.rst:1534
-msgid ""
-"Execute 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."
+"`PyConfig.base_executable`."
msgstr ""
-#: ../../c-api/init_config.rst:1539
-msgid "By default and when if :option:`-i` option is used, run the REPL."
-msgstr ""
-
-#: ../../c-api/init_config.rst:1541
-msgid ""
-"Finally, finalizes Python and returns an exit status that can be passed to "
-"the ``exit()`` function."
-msgstr ""
-
-#: ../../c-api/init_config.rst:1544
-msgid ""
-"See :ref:`Python Configuration ` for an example of "
-"customized Python always running in isolated mode using :c:func:`Py_RunMain`."
-msgstr ""
-
-#: ../../c-api/init_config.rst:1550
+#: ../../c-api/init_config.rst:1588
msgid "Py_GetArgcArgv()"
msgstr "Py_GetArgcArgv()"
-#: ../../c-api/init_config.rst:1554
+#: ../../c-api/init_config.rst:1592
msgid "Get the original command line arguments, before Python modified them."
msgstr ""
-#: ../../c-api/init_config.rst:1556
+#: ../../c-api/init_config.rst:1594
msgid "See also :c:member:`PyConfig.orig_argv` member."
-msgstr ""
+msgstr "也請參與 :c:member:`PyConfig.orig_argv` 成員。"
-#: ../../c-api/init_config.rst:1560
+#: ../../c-api/init_config.rst:1598
msgid "Multi-Phase Initialization Private Provisional API"
msgstr ""
-#: ../../c-api/init_config.rst:1562
+#: ../../c-api/init_config.rst:1600
msgid ""
"This section is a private provisional API introducing multi-phase "
"initialization, the core feature of :pep:`432`:"
msgstr ""
-#: ../../c-api/init_config.rst:1565
+#: ../../c-api/init_config.rst:1603
msgid "\"Core\" initialization phase, \"bare minimum Python\":"
msgstr ""
-#: ../../c-api/init_config.rst:1567
+#: ../../c-api/init_config.rst:1605
msgid "Builtin types;"
msgstr "內建型別;"
-#: ../../c-api/init_config.rst:1568
+#: ../../c-api/init_config.rst:1606
msgid "Builtin exceptions;"
msgstr "內建例外;"
-#: ../../c-api/init_config.rst:1569
+#: ../../c-api/init_config.rst:1607
msgid "Builtin and frozen modules;"
msgstr ""
-#: ../../c-api/init_config.rst:1570
+#: ../../c-api/init_config.rst:1608
msgid ""
"The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` "
"doesn't exist yet)."
msgstr ""
-#: ../../c-api/init_config.rst:1573
+#: ../../c-api/init_config.rst:1611
msgid "\"Main\" initialization phase, Python is fully initialized:"
msgstr ""
-#: ../../c-api/init_config.rst:1575
+#: ../../c-api/init_config.rst:1613
msgid "Install and configure :mod:`importlib`;"
msgstr ""
-#: ../../c-api/init_config.rst:1576
+#: ../../c-api/init_config.rst:1614
msgid "Apply the :ref:`Path Configuration `;"
msgstr ""
-#: ../../c-api/init_config.rst:1577
+#: ../../c-api/init_config.rst:1615
msgid "Install signal handlers;"
msgstr ""
-#: ../../c-api/init_config.rst:1578
+#: ../../c-api/init_config.rst:1616
msgid ""
"Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :"
"data:`sys.path`);"
msgstr ""
-#: ../../c-api/init_config.rst:1580
+#: ../../c-api/init_config.rst:1618
msgid ""
"Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;"
msgstr ""
-#: ../../c-api/init_config.rst:1581
+#: ../../c-api/init_config.rst:1619
msgid "Import the :mod:`site` module;"
msgstr "引入 :mod:`site` 模組;"
-#: ../../c-api/init_config.rst:1582
+#: ../../c-api/init_config.rst:1620
msgid "etc."
msgstr ""
-#: ../../c-api/init_config.rst:1584
+#: ../../c-api/init_config.rst:1622
msgid "Private provisional API:"
msgstr ""
-#: ../../c-api/init_config.rst:1586
+#: ../../c-api/init_config.rst:1624
msgid ""
":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:"
"`Py_InitializeFromConfig` stops at the \"Core\" initialization phase."
msgstr ""
-#: ../../c-api/init_config.rst:1591
+#: ../../c-api/init_config.rst:1629
msgid ""
"Move to the \"Main\" initialization phase, finish the Python initialization."
msgstr ""
-#: ../../c-api/init_config.rst:1593
+#: ../../c-api/init_config.rst:1631
msgid ""
"No module is imported during the \"Core\" phase and the ``importlib`` module "
"is not configured: the :ref:`Path Configuration ` is only "
@@ -2301,14 +2343,14 @@ msgid ""
"maybe install a custom :data:`sys.meta_path` importer or an import hook, etc."
msgstr ""
-#: ../../c-api/init_config.rst:1599
+#: ../../c-api/init_config.rst:1637
msgid ""
"It may become possible to calculate the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is "
"one of the :pep:`432` motivation."
msgstr ""
-#: ../../c-api/init_config.rst:1603
+#: ../../c-api/init_config.rst:1641
msgid ""
"The \"Core\" phase is not properly defined: what should be and what should "
"not be available at this phase is not specified yet. The API is marked as "
@@ -2316,13 +2358,13 @@ msgid ""
"until a proper public API is designed."
msgstr ""
-#: ../../c-api/init_config.rst:1608
+#: ../../c-api/init_config.rst:1646
msgid ""
"Example running Python code between \"Core\" and \"Main\" initialization "
"phases::"
msgstr ""
-#: ../../c-api/init_config.rst:1611
+#: ../../c-api/init_config.rst:1649
msgid ""
"void init_python(void)\n"
"{\n"
@@ -2358,3 +2400,11 @@ msgid ""
" }\n"
"}"
msgstr ""
+
+#: ../../c-api/init_config.rst:558
+msgid "main()"
+msgstr "main()"
+
+#: ../../c-api/init_config.rst:558
+msgid "argv (in module sys)"
+msgstr ""
diff --git a/c-api/intro.po b/c-api/intro.po
index 5432552e14..f246ab03ee 100644
--- a/c-api/intro.po
+++ b/c-api/intro.po
@@ -1,14 +1,13 @@
-# 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:
# Matt Wang , 2023
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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-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,67 +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` 在標準路徑前面插入額外的目"
-"錄。"
-
-#: ../../c-api/intro.rst:779
-msgid ""
-"The embedding application can steer the search by calling "
-"``Py_SetProgramName(file)`` *before* calling :c:func:`Py_Initialize`. 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`)."
+"執行檔案時使用。)使用者可以透過設定環境變數來覆蓋此行"
+"為 :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`)."
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"
@@ -1264,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` 檔案有一份包含多種除"
@@ -1279,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 ""
@@ -1301,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"
@@ -1426,10 +1434,6 @@ msgstr "path(路徑)"
msgid "path (in module sys)"
msgstr "path(sys 模組中)"
-#: ../../c-api/intro.rst:772
-msgid "Py_SetProgramName (C function)"
-msgstr "Py_SetProgramName(C 函式)"
-
#: ../../c-api/intro.rst:772
msgid "Py_GetPath (C function)"
msgstr "Py_GetPath(C 函式)"
@@ -1449,3 +1453,6 @@ msgstr "Py_GetProgramFullPath(C 函式)"
#: ../../c-api/intro.rst:787
msgid "Py_IsInitialized (C function)"
msgstr "Py_IsInitialized(C 函式)"
+
+#~ msgid "Py_SetProgramName (C function)"
+#~ msgstr "Py_SetProgramName(C 函式)"
diff --git a/c-api/iter.po b/c-api/iter.po
index 8b674435cc..ac90b9dc26 100644
--- a/c-api/iter.po
+++ b/c-api/iter.po
@@ -6,7 +6,7 @@
# Matt Wang , 2023
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2023-07-01 03:44+0800\n"
diff --git a/c-api/iterator.po b/c-api/iterator.po
index fe68f1fa77..3675b02e9a 100644
--- a/c-api/iterator.po
+++ b/c-api/iterator.po
@@ -6,7 +6,7 @@
# Leon H., 2017
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-24 00:03+0000\n"
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
diff --git a/c-api/list.po b/c-api/list.po
index ed430f77a6..5b7fb4a6e1 100644
--- a/c-api/list.po
+++ b/c-api/list.po
@@ -6,9 +6,9 @@
# Matt Wang , 2023
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-05-09 00:15+0000\n"
+"POT-Creation-Date: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2023-08-24 00:55+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -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 ""
@@ -59,41 +59,51 @@ msgstr "成功時回傳長度為 *len* 的新串列,失敗時回傳 ``NULL``
#: ../../c-api/list.rst:40
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`."
+"``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:50
+#: ../../c-api/list.rst:53
msgid ""
"Return the length of the list object in *list*; this is equivalent to "
"``len(list)`` on a list object."
msgstr "回傳 *list* 串列物件的長度;這相當於串列物件的 ``len(list)``。"
-#: ../../c-api/list.rst:56
+#: ../../c-api/list.rst:59
msgid "Similar to :c:func:`PyList_Size`, but without error checking."
msgstr "與 :c:func:`PyList_Size` 類似,但沒有錯誤檢查。"
-#: ../../c-api/list.rst:61
+#: ../../c-api/list.rst:64
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 "
-"supported. If *index* is out of bounds (<0 or >=len(list)), return ``NULL`` "
-"and set an :exc:`IndexError` exception."
+"supported. If *index* is out of bounds (:code:`<0 or >=len(list)`), return "
+"``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:69
+#: ../../c-api/list.rst:74
+msgid ""
+"Like :c:func:`PyList_GetItemRef`, but returns a :term:`borrowed reference` "
+"instead of a :term:`strong reference`."
+msgstr ""
+
+#: ../../c-api/list.rst:80
msgid "Similar to :c:func:`PyList_GetItem`, but without error checking."
msgstr "與 :c:func:`PyList_GetItem` 類似,但沒有錯誤檢查。"
-#: ../../c-api/list.rst:74
+#: ../../c-api/list.rst:85
msgid ""
"Set the item at index *index* in list to *item*. Return ``0`` on success. "
"If *index* is out of bounds, return ``-1`` and set an :exc:`IndexError` "
@@ -102,14 +112,14 @@ msgstr ""
"將串列中索引 *index* 處的項目設定為 *item*。成功時回傳 ``0``。如果 *index* 超"
"出邊界範圍則回傳 ``-1`` 並設定一個 :exc:`IndexError` 例外。"
-#: ../../c-api/list.rst:80
+#: ../../c-api/list.rst:91
msgid ""
"This function \"steals\" a reference to *item* and discards a reference to "
"an item already in the list at the affected position."
msgstr ""
"此函式「竊取」對 *item* 的參照,並丟棄對串列中受影響位置上已存在項目的參照。"
-#: ../../c-api/list.rst:86
+#: ../../c-api/list.rst:97
msgid ""
"Macro form of :c:func:`PyList_SetItem` without error checking. This is "
"normally only used to fill in new lists where there is no previous content."
@@ -117,17 +127,25 @@ msgstr ""
":c:func:`PyList_SetItem` 的巨集形式,沒有錯誤檢查。這通常僅用於填充沒有已存在"
"內容的新串列。"
-#: ../../c-api/list.rst:91
+#: ../../c-api/list.rst:100
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."
+"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."
msgstr ""
"該巨集「竊取」對 *item* 的參照,並且與 :c:func:`PyList_SetItem` 不同的是,它"
"\\ *不會*\\ 丟棄對任意被替換項目的參照;*list* 中位置 *i* 的任何參照都將被洩"
"漏 (leak)。"
-#: ../../c-api/list.rst:99
+#: ../../c-api/list.rst:114
msgid ""
"Insert the item *item* into list *list* in front of index *index*. Return "
"``0`` if successful; return ``-1`` and set an exception if unsuccessful. "
@@ -137,7 +155,7 @@ msgstr ""
"``0``;如果失敗則回傳 ``-1`` 並設定例外。類似於 ``list.insert(index, "
"item)``。"
-#: ../../c-api/list.rst:106
+#: ../../c-api/list.rst:121
msgid ""
"Append the object *item* at the end of list *list*. Return ``0`` if "
"successful; return ``-1`` and set an exception if unsuccessful. Analogous "
@@ -146,7 +164,7 @@ msgstr ""
"將物件 *item* 附加到串列 *list* 的最後面。如果成功則回傳 ``0``;如果不成功,"
"則回傳 ``-1`` 並設定例外。類似於 ``list.append(item)``。"
-#: ../../c-api/list.rst:113
+#: ../../c-api/list.rst:128
msgid ""
"Return a list of the objects in *list* containing the objects *between* "
"*low* and *high*. Return ``NULL`` and set an exception if unsuccessful. "
@@ -157,7 +175,7 @@ msgstr ""
"成功則回傳 ``NULL`` 並設定例外。類似於 ``list[low:high]``。不支援從串列尾末開"
"始索引。"
-#: ../../c-api/list.rst:120
+#: ../../c-api/list.rst:135
msgid ""
"Set the slice of *list* between *low* and *high* to the contents of "
"*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may "
@@ -170,7 +188,33 @@ msgstr ""
"(切片刪除)。成功時回傳 ``0``,失敗時則回傳 ``-1``。不支援從串列尾末開始索"
"引。"
-#: ../../c-api/list.rst:129
+#: ../../c-api/list.rst:144
+msgid ""
+"Extend *list* with the contents of *iterable*. This is the same as "
+"``PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable)`` and "
+"analogous to ``list.extend(iterable)`` or ``list += iterable``."
+msgstr ""
+
+#: ../../c-api/list.rst:148
+msgid ""
+"Raise an exception and return ``-1`` if *list* is not a :class:`list` "
+"object. Return 0 on success."
+msgstr ""
+
+#: ../../c-api/list.rst:156
+msgid ""
+"Remove all items from *list*. This is the same as ``PyList_SetSlice(list, "
+"0, PY_SSIZE_T_MAX, NULL)`` and analogous to ``list.clear()`` or ``del "
+"list[:]``."
+msgstr ""
+
+#: ../../c-api/list.rst:160
+msgid ""
+"Raise an exception and return ``-1`` if *list* is not a :class:`list` "
+"object. Return 0 on success."
+msgstr ""
+
+#: ../../c-api/list.rst:168
msgid ""
"Sort the items of *list* in place. Return ``0`` on success, ``-1`` on "
"failure. This is equivalent to ``list.sort()``."
@@ -178,15 +222,15 @@ msgstr ""
"對 *list* 的項目進行原地 (in place) 排序。成功時回傳 ``0``,失敗時回傳 "
"``-1``。這相當於 ``list.sort()``。"
-#: ../../c-api/list.rst:135
+#: ../../c-api/list.rst:174
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:143
+#: ../../c-api/list.rst:182
msgid ""
"Return a new tuple object containing the contents of *list*; equivalent to "
"``tuple(list)``."
@@ -202,14 +246,14 @@ msgstr "object(物件)"
msgid "list"
msgstr "list(串列)"
-#: ../../c-api/list.rst:48 ../../c-api/list.rst:141
+#: ../../c-api/list.rst:51 ../../c-api/list.rst:180
msgid "built-in function"
msgstr "built-in function(內建函式)"
-#: ../../c-api/list.rst:48
+#: ../../c-api/list.rst:51
msgid "len"
msgstr "len"
-#: ../../c-api/list.rst:141
+#: ../../c-api/list.rst:180
msgid "tuple"
msgstr "tuple(元組)"
diff --git a/c-api/long.po b/c-api/long.po
index dc269967a2..0df0341414 100644
--- a/c-api/long.po
+++ b/c-api/long.po
@@ -5,9 +5,9 @@
# Leon H., 2017
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-08-06 00:03+0000\n"
+"POT-Creation-Date: 2024-10-22 00:13+0000\n"
"PO-Revision-Date: 2018-05-23 14:06+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -138,35 +138,80 @@ msgid ""
"retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`."
msgstr ""
-#: ../../c-api/long.rst:123 ../../c-api/long.rst:141
+#: ../../c-api/long.rst:118
+msgid ""
+"Create a Python integer from the value contained in the first *n_bytes* of "
+"*buffer*, interpreted as a two's-complement signed number."
+msgstr ""
+
+#: ../../c-api/long.rst:121
+msgid ""
+"*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will "
+"select the native endian that CPython was compiled with and assume that the "
+"most-significant bit is a sign bit. Passing "
+"``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` will produce the same result as "
+"calling :c:func:`PyLong_FromUnsignedNativeBytes`. Other flags are ignored."
+msgstr ""
+
+#: ../../c-api/long.rst:132
+msgid ""
+"Create a Python integer from the value contained in the first *n_bytes* of "
+"*buffer*, interpreted as an unsigned number."
+msgstr ""
+
+#: ../../c-api/long.rst:135
+msgid ""
+"*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will "
+"select the native endian that CPython was compiled with and assume that the "
+"most-significant bit is not a sign bit. Flags other than endian are ignored."
+msgstr ""
+
+#: ../../c-api/long.rst:148 ../../c-api/long.rst:184
msgid ""
"Return a C :c:expr:`long` representation of *obj*. If *obj* is not an "
"instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` "
"method (if present) to convert it to a :c:type:`PyLongObject`."
msgstr ""
-#: ../../c-api/long.rst:127
+#: ../../c-api/long.rst:152
msgid ""
"Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:"
"expr:`long`."
msgstr ""
-#: ../../c-api/long.rst:130 ../../c-api/long.rst:150 ../../c-api/long.rst:171
-#: ../../c-api/long.rst:191 ../../c-api/long.rst:214
+#: ../../c-api/long.rst:155 ../../c-api/long.rst:193 ../../c-api/long.rst:214
+#: ../../c-api/long.rst:234 ../../c-api/long.rst:257
msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate."
msgstr ""
-#: ../../c-api/long.rst:132 ../../c-api/long.rst:152 ../../c-api/long.rst:173
-#: ../../c-api/long.rst:195 ../../c-api/long.rst:279 ../../c-api/long.rst:299
+#: ../../c-api/long.rst:157 ../../c-api/long.rst:195 ../../c-api/long.rst:216
+#: ../../c-api/long.rst:238 ../../c-api/long.rst:322 ../../c-api/long.rst:342
msgid "Use :meth:`~object.__index__` if available."
msgstr ""
-#: ../../c-api/long.rst:135 ../../c-api/long.rst:155 ../../c-api/long.rst:176
-#: ../../c-api/long.rst:198 ../../c-api/long.rst:282 ../../c-api/long.rst:302
+#: ../../c-api/long.rst:160 ../../c-api/long.rst:198 ../../c-api/long.rst:219
+#: ../../c-api/long.rst:241 ../../c-api/long.rst:325 ../../c-api/long.rst:345
msgid "This function will no longer use :meth:`~object.__int__`."
msgstr ""
-#: ../../c-api/long.rst:145
+#: ../../c-api/long.rst:167
+msgid ""
+"A :term:`soft deprecated` alias. Exactly equivalent to the preferred "
+"``PyLong_AsLong``. In particular, it can fail with :exc:`OverflowError` or "
+"another exception."
+msgstr ""
+
+#: ../../c-api/long.rst:171
+msgid "The function is soft deprecated."
+msgstr ""
+
+#: ../../c-api/long.rst:176
+msgid ""
+"Similar to :c:func:`PyLong_AsLong`, but store the result in a C :c:expr:"
+"`int` instead of a C :c:expr:`long`."
+msgstr ""
+
+#: ../../c-api/long.rst:188
msgid ""
"If the value of *obj* is greater than :c:macro:`LONG_MAX` or less than :c:"
"macro:`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and "
@@ -174,20 +219,20 @@ msgid ""
"exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual."
msgstr ""
-#: ../../c-api/long.rst:164 ../../c-api/long.rst:182
+#: ../../c-api/long.rst:207 ../../c-api/long.rst:225
msgid ""
"Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an "
"instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` "
"method (if present) to convert it to a :c:type:`PyLongObject`."
msgstr ""
-#: ../../c-api/long.rst:168
+#: ../../c-api/long.rst:211
msgid ""
"Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:"
"expr:`long long`."
msgstr ""
-#: ../../c-api/long.rst:186
+#: ../../c-api/long.rst:229
msgid ""
"If the value of *obj* is greater than :c:macro:`LLONG_MAX` or less than :c:"
"macro:`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and "
@@ -195,133 +240,133 @@ msgid ""
"exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual."
msgstr ""
-#: ../../c-api/long.rst:208
+#: ../../c-api/long.rst:251
msgid ""
"Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must "
"be an instance of :c:type:`PyLongObject`."
msgstr ""
-#: ../../c-api/long.rst:211
+#: ../../c-api/long.rst:254
msgid ""
"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:"
"type:`Py_ssize_t`."
msgstr ""
-#: ../../c-api/long.rst:223
+#: ../../c-api/long.rst:266
msgid ""
"Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* "
"must be an instance of :c:type:`PyLongObject`."
msgstr ""
-#: ../../c-api/long.rst:226
+#: ../../c-api/long.rst:269
msgid ""
"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:"
"expr:`unsigned long`."
msgstr ""
-#: ../../c-api/long.rst:229
+#: ../../c-api/long.rst:272
msgid ""
"Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to "
"disambiguate."
msgstr ""
-#: ../../c-api/long.rst:239
+#: ../../c-api/long.rst:282
msgid ""
"Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an "
"instance of :c:type:`PyLongObject`."
msgstr ""
-#: ../../c-api/long.rst:242
+#: ../../c-api/long.rst:285
msgid ""
"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:"
"type:`size_t`."
msgstr ""
-#: ../../c-api/long.rst:245
+#: ../../c-api/long.rst:288
msgid ""
"Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to "
"disambiguate."
msgstr ""
-#: ../../c-api/long.rst:254
+#: ../../c-api/long.rst:297
msgid ""
"Return a C :c:expr:`unsigned long long` representation of *pylong*. "
"*pylong* must be an instance of :c:type:`PyLongObject`."
msgstr ""
-#: ../../c-api/long.rst:257
+#: ../../c-api/long.rst:300
msgid ""
"Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :"
"c:expr:`unsigned long long`."
msgstr ""
-#: ../../c-api/long.rst:260
+#: ../../c-api/long.rst:303
msgid ""
"Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to "
"disambiguate."
msgstr ""
-#: ../../c-api/long.rst:263
+#: ../../c-api/long.rst:306
msgid ""
"A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`."
msgstr ""
-#: ../../c-api/long.rst:269
+#: ../../c-api/long.rst:312
msgid ""
"Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not "
"an instance of :c:type:`PyLongObject`, first call its :meth:`~object."
"__index__` method (if present) to convert it to a :c:type:`PyLongObject`."
msgstr ""
-#: ../../c-api/long.rst:273
+#: ../../c-api/long.rst:316
msgid ""
"If the value of *obj* is out of range for an :c:expr:`unsigned long`, return "
"the reduction of that value modulo ``ULONG_MAX + 1``."
msgstr ""
-#: ../../c-api/long.rst:276
+#: ../../c-api/long.rst:319
msgid ""
"Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to "
"disambiguate."
msgstr ""
-#: ../../c-api/long.rst:288
+#: ../../c-api/long.rst:331
msgid ""
"Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* "
"is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object."
"__index__` method (if present) to convert it to a :c:type:`PyLongObject`."
msgstr ""
-#: ../../c-api/long.rst:293
+#: ../../c-api/long.rst:336
msgid ""
"If the value of *obj* is out of range for an :c:expr:`unsigned long long`, "
"return the reduction of that value modulo ``ULLONG_MAX + 1``."
msgstr ""
-#: ../../c-api/long.rst:296
+#: ../../c-api/long.rst:339
msgid ""
"Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` "
"to disambiguate."
msgstr ""
-#: ../../c-api/long.rst:308
+#: ../../c-api/long.rst:351
msgid ""
"Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an "
"instance of :c:type:`PyLongObject`."
msgstr ""
-#: ../../c-api/long.rst:311
+#: ../../c-api/long.rst:354
msgid ""
"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:"
"expr:`double`."
msgstr ""
-#: ../../c-api/long.rst:314
+#: ../../c-api/long.rst:357
msgid ""
"Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate."
msgstr ""
-#: ../../c-api/long.rst:319
+#: ../../c-api/long.rst:362
msgid ""
"Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* "
"cannot be converted, an :exc:`OverflowError` will be raised. This is only "
@@ -329,52 +374,263 @@ msgid ""
"c:func:`PyLong_FromVoidPtr`."
msgstr ""
-#: ../../c-api/long.rst:324
+#: ../../c-api/long.rst:367
msgid ""
"Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate."
msgstr ""
-#: ../../c-api/long.rst:329
+#: ../../c-api/long.rst:372
+msgid ""
+"Copy the Python integer value *pylong* to a native *buffer* of size "
+"*n_bytes*. The *flags* can be set to ``-1`` to behave similarly to a C cast, "
+"or to values documented below to control the behavior."
+msgstr ""
+
+#: ../../c-api/long.rst:376
+msgid ""
+"Returns ``-1`` with an exception raised on error. This may happen if "
+"*pylong* cannot be interpreted as an integer, or if *pylong* was negative "
+"and the ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` flag was set."
+msgstr ""
+
+#: ../../c-api/long.rst:380
+msgid ""
+"Otherwise, returns the number of bytes required to store the value. If this "
+"is equal to or less than *n_bytes*, the entire value was copied. All "
+"*n_bytes* of the buffer are written: large buffers are padded with zeroes."
+msgstr ""
+
+#: ../../c-api/long.rst:385
+msgid ""
+"If the returned value is greater than than *n_bytes*, the value was "
+"truncated: as many of the lowest bits of the value as could fit are written, "
+"and the higher bits are ignored. This matches the typical behavior of a C-"
+"style downcast."
+msgstr ""
+
+#: ../../c-api/long.rst:392
+msgid ""
+"Overflow is not considered an error. If the returned value is larger than "
+"*n_bytes*, most significant bits were discarded."
+msgstr ""
+
+#: ../../c-api/long.rst:395
+msgid "``0`` will never be returned."
+msgstr "``0`` 將永不被回傳。"
+
+#: ../../c-api/long.rst:397
+msgid "Values are always copied as two's-complement."
+msgstr ""
+
+#: ../../c-api/long.rst:399
+msgid "Usage example::"
+msgstr "使用範例: ::"
+
+#: ../../c-api/long.rst:401
+msgid ""
+"int32_t value;\n"
+"Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, &value, sizeof(value), -1);\n"
+"if (bytes < 0) {\n"
+" // Failed. A Python exception was set with the reason.\n"
+" return NULL;\n"
+"}\n"
+"else if (bytes <= (Py_ssize_t)sizeof(value)) {\n"
+" // Success!\n"
+"}\n"
+"else {\n"
+" // Overflow occurred, but 'value' contains the truncated\n"
+" // lowest bits of pylong.\n"
+"}"
+msgstr ""
+
+#: ../../c-api/long.rst:415
+msgid ""
+"Passing zero to *n_bytes* will return the size of a buffer that would be "
+"large enough to hold the value. This may be larger than technically "
+"necessary, but not unreasonably so. If *n_bytes=0*, *buffer* may be ``NULL``."
+msgstr ""
+
+#: ../../c-api/long.rst:422
+msgid ""
+"Passing *n_bytes=0* to this function is not an accurate way to determine the "
+"bit length of the value."
+msgstr ""
+
+#: ../../c-api/long.rst:425
+msgid ""
+"To get at the entire Python value of an unknown size, the function can be "
+"called twice: first to determine the buffer size, then to fill it::"
+msgstr ""
+
+#: ../../c-api/long.rst:428
+msgid ""
+"// Ask how much space we need.\n"
+"Py_ssize_t expected = PyLong_AsNativeBytes(pylong, NULL, 0, -1);\n"
+"if (expected < 0) {\n"
+" // Failed. A Python exception was set with the reason.\n"
+" return NULL;\n"
+"}\n"
+"assert(expected != 0); // Impossible per the API definition.\n"
+"uint8_t *bignum = malloc(expected);\n"
+"if (!bignum) {\n"
+" PyErr_SetString(PyExc_MemoryError, \"bignum malloc failed.\");\n"
+" return NULL;\n"
+"}\n"
+"// Safely get the entire value.\n"
+"Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, bignum, expected, -1);\n"
+"if (bytes < 0) { // Exception has been set.\n"
+" free(bignum);\n"
+" return NULL;\n"
+"}\n"
+"else if (bytes > expected) { // This should not be possible.\n"
+" PyErr_SetString(PyExc_RuntimeError,\n"
+" \"Unexpected bignum truncation after a size check.\");\n"
+" free(bignum);\n"
+" return NULL;\n"
+"}\n"
+"// The expected success given the above pre-check.\n"
+"// ... use bignum ...\n"
+"free(bignum);"
+msgstr ""
+
+#: ../../c-api/long.rst:456
+msgid ""
+"*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults "
+"that behave most like a C cast, or a combination of the other flags in the "
+"table below. Note that ``-1`` cannot be combined with other flags."
+msgstr ""
+
+#: ../../c-api/long.rst:461
+msgid ""
+"Currently, ``-1`` corresponds to ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | "
+"Py_ASNATIVEBYTES_UNSIGNED_BUFFER``."
+msgstr ""
+
+#: ../../c-api/long.rst:467
+msgid "Flag"
+msgstr "旗標"
+
+#: ../../c-api/long.rst:467
+msgid "Value"
+msgstr "數值"
+
+#: ../../c-api/long.rst:469
+msgid "``-1``"
+msgstr "``-1``"
+
+#: ../../c-api/long.rst:470
+msgid "``0``"
+msgstr "``0``"
+
+#: ../../c-api/long.rst:471
+msgid "``1``"
+msgstr "``1``"
+
+#: ../../c-api/long.rst:472
+msgid "``3``"
+msgstr "``3``"
+
+#: ../../c-api/long.rst:473
+msgid "``4``"
+msgstr "``4``"
+
+#: ../../c-api/long.rst:474
+msgid "``8``"
+msgstr "``8``"
+
+#: ../../c-api/long.rst:475
+msgid "``16``"
+msgstr "``16``"
+
+#: ../../c-api/long.rst:478
+msgid ""
+"Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other endian "
+"flags. Passing ``2`` is reserved."
+msgstr ""
+
+#: ../../c-api/long.rst:481
+msgid ""
+"By default, sufficient buffer will be requested to include a sign bit. For "
+"example, when converting 128 with *n_bytes=1*, the function will return 2 "
+"(or more) in order to store a zero sign bit."
+msgstr ""
+
+#: ../../c-api/long.rst:485
+msgid ""
+"If ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` is specified, a zero sign bit will "
+"be omitted from size calculations. This allows, for example, 128 to fit in a "
+"single-byte buffer. If the destination buffer is later treated as signed, a "
+"positive input value may become negative. Note that the flag does not affect "
+"handling of negative values: for those, space for a sign bit is always "
+"requested."
+msgstr ""
+
+#: ../../c-api/long.rst:492
+msgid ""
+"Specifying ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` causes an exception to be "
+"set if *pylong* is negative. Without this flag, negative values will be "
+"copied provided there is enough space for at least one sign bit, regardless "
+"of whether ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` was specified."
+msgstr ""
+
+#: ../../c-api/long.rst:497
+msgid ""
+"If ``Py_ASNATIVEBYTES_ALLOW_INDEX`` is specified and a non-integer value is "
+"passed, its :meth:`~object.__index__` method will be called first. This may "
+"result in Python code executing and other threads being allowed to run, "
+"which could cause changes to other objects or values in use. When *flags* is "
+"``-1``, this option is not set, and non-integer values will raise :exc:"
+"`TypeError`."
+msgstr ""
+
+#: ../../c-api/long.rst:506
+msgid ""
+"With the default *flags* (``-1``, or *UNSIGNED_BUFFER* without "
+"*REJECT_NEGATIVE*), multiple Python integers can map to a single value "
+"without overflow. For example, both ``255`` and ``-1`` fit a single-byte "
+"buffer and set all its bits. This matches typical C cast behavior."
+msgstr ""
+
+#: ../../c-api/long.rst:517
msgid ""
"On success, return a read only :term:`named tuple`, that holds information "
"about Python's internal representation of integers. See :data:`sys.int_info` "
"for description of individual fields."
msgstr ""
-#: ../../c-api/long.rst:333
+#: ../../c-api/long.rst:521
msgid "On failure, return ``NULL`` with an exception set."
msgstr "在失敗時,會回傳 ``NULL`` 並設定例外。"
-#: ../../c-api/long.rst:340
+#: ../../c-api/long.rst:528
msgid "Return 1 if *op* is compact, 0 otherwise."
msgstr ""
-#: ../../c-api/long.rst:342
+#: ../../c-api/long.rst:530
msgid ""
"This function makes it possible for performance-critical code to implement a "
"“fast path” for small integers. For compact values use :c:func:"
"`PyUnstable_Long_CompactValue`; for others fall back to a :c:func:"
-"`PyLong_As* ` function or :c:func:`calling "
-"` :meth:`int.to_bytes`."
+"`PyLong_As* ` function or :c:func:`PyLong_AsNativeBytes`."
msgstr ""
-#: ../../c-api/long.rst:348
+#: ../../c-api/long.rst:536
msgid "The speedup is expected to be negligible for most users."
msgstr ""
-#: ../../c-api/long.rst:350
+#: ../../c-api/long.rst:538
msgid ""
"Exactly what values are considered compact is an implementation detail and "
"is subject to change."
msgstr ""
-#: ../../c-api/long.rst:355
+#: ../../c-api/long.rst:546
msgid ""
"If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, "
"return its value."
msgstr ""
-#: ../../c-api/long.rst:358
+#: ../../c-api/long.rst:549
msgid "Otherwise, the return value is undefined."
msgstr ""
@@ -384,29 +640,29 @@ 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:119
+#: ../../c-api/long.rst:144
msgid "LONG_MAX (C macro)"
msgstr "LONG_MAX(C 巨集)"
-#: ../../c-api/long.rst:119 ../../c-api/long.rst:161 ../../c-api/long.rst:204
-#: ../../c-api/long.rst:219 ../../c-api/long.rst:235 ../../c-api/long.rst:251
+#: ../../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:204
+#: ../../c-api/long.rst:247
msgid "PY_SSIZE_T_MAX (C macro)"
msgstr "PY_SSIZE_T_MAX(C 巨集)"
-#: ../../c-api/long.rst:219
+#: ../../c-api/long.rst:262
msgid "ULONG_MAX (C macro)"
msgstr "ULONG_MAX(C 巨集)"
-#: ../../c-api/long.rst:235
+#: ../../c-api/long.rst:278
msgid "SIZE_MAX (C macro)"
msgstr "SIZE_MAX(C 巨集)"
diff --git a/c-api/mapping.po b/c-api/mapping.po
index aa99402ad8..49e8987a80 100644
--- a/c-api/mapping.po
+++ b/c-api/mapping.po
@@ -5,9 +5,9 @@
# Matt Wang , 2024
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-09-03 00:03+0000\n"
+"POT-Creation-Date: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2024-05-11 14:32+0800\n"
"Last-Translator: Matt Wang \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -61,6 +61,31 @@ msgstr ""
#: ../../c-api/mapping.rst:38
msgid ""
+"Variant of :c:func:`PyObject_GetItem` which doesn't raise :exc:`KeyError` if "
+"the key is not found."
+msgstr ""
+
+#: ../../c-api/mapping.rst:41
+msgid ""
+"If the key is found, return ``1`` and set *\\*result* to a new :term:`strong "
+"reference` to the corresponding value. If the key is not found, return ``0`` "
+"and set *\\*result* to ``NULL``; the :exc:`KeyError` is silenced. If an "
+"error other than :exc:`KeyError` is raised, return ``-1`` and set "
+"*\\*result* to ``NULL``."
+msgstr ""
+
+#: ../../c-api/mapping.rst:53
+#, fuzzy
+msgid ""
+"This is the same as :c:func:`PyMapping_GetOptionalItem`, but *key* is "
+"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
+msgstr ""
+"這與 :c:func:`PyMapping_HasKey` 相同,但 *key* 被指定為 :c:expr:`const "
+"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。"
+
+#: ../../c-api/mapping.rst:62
+msgid ""
"This is the same as :c:func:`PyObject_SetItem`, but *key* is specified as a :"
"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
"`PyObject*`."
@@ -68,11 +93,11 @@ msgstr ""
"這與 :c:func:`PyObject_SetItem` 相同,但 *key* 被指定為 :c:expr:`const "
"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。"
-#: ../../c-api/mapping.rst:45
+#: ../../c-api/mapping.rst:69
msgid "This is an alias of :c:func:`PyObject_DelItem`."
msgstr "這是 :c:func:`PyObject_DelItem` 的別名。"
-#: ../../c-api/mapping.rst:50
+#: ../../c-api/mapping.rst:74
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:"
@@ -81,7 +106,27 @@ msgstr ""
"這與 :c:func:`PyObject_DelItem` 相同,但 *key* 被指定為 :c:expr:`const "
"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。"
-#: ../../c-api/mapping.rst:57
+#: ../../c-api/mapping.rst:81
+#, fuzzy
+msgid ""
+"Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. "
+"This is equivalent to the Python expression ``key in o``. On failure, return "
+"``-1``."
+msgstr ""
+"如果對映物件具有鍵 *key* 則回傳 ``1``,否則回傳 ``0``。這相當於 Python 運算"
+"式 ``key in o``。這個函式總會是成功的。"
+
+#: ../../c-api/mapping.rst:90
+#, fuzzy
+msgid ""
+"This is the same as :c:func:`PyMapping_HasKeyWithError`, but *key* is "
+"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than "
+"a :c:expr:`PyObject*`."
+msgstr ""
+"這與 :c:func:`PyMapping_HasKey` 相同,但 *key* 被指定為 :c:expr:`const "
+"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。"
+
+#: ../../c-api/mapping.rst:99
msgid ""
"Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. "
"This is equivalent to the Python expression ``key in o``. This function "
@@ -90,16 +135,18 @@ msgstr ""
"如果對映物件具有鍵 *key* 則回傳 ``1``,否則回傳 ``0``。這相當於 Python 運算"
"式 ``key in o``。這個函式總會是成功的。"
-#: ../../c-api/mapping.rst:63
+#: ../../c-api/mapping.rst:105
+#, fuzzy
msgid ""
"Exceptions which occur when this calls :meth:`~object.__getitem__` method "
"are silently ignored. For proper error handling, use :c:func:"
+"`PyMapping_HasKeyWithError`, :c:func:`PyMapping_GetOptionalItem` or :c:func:"
"`PyObject_GetItem()` instead."
msgstr ""
"當它呼叫 :meth:`~object.__getitem__` 方法時發生的例外將被默默忽略。為了適當地"
"處理錯誤,請改用 :c:func:`PyObject_GetItem()`。"
-#: ../../c-api/mapping.rst:70
+#: ../../c-api/mapping.rst:113
msgid ""
"This is the same as :c:func:`PyMapping_HasKey`, but *key* is specified as a :"
"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:"
@@ -108,34 +155,37 @@ msgstr ""
"這與 :c:func:`PyMapping_HasKey` 相同,但 *key* 被指定為 :c:expr:`const "
"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。"
-#: ../../c-api/mapping.rst:76
+#: ../../c-api/mapping.rst:119
+#, fuzzy
msgid ""
"Exceptions that occur when this calls :meth:`~object.__getitem__` method or "
"while creating the temporary :class:`str` object are silently ignored. For "
-"proper error handling, use :c:func:`PyMapping_GetItemString` instead."
+"proper error handling, use :c:func:`PyMapping_HasKeyStringWithError`, :c:"
+"func:`PyMapping_GetOptionalItemString` or :c:func:`PyMapping_GetItemString` "
+"instead."
msgstr ""
"當它呼叫 :meth:`~object.__getitem__` 方法或建立臨時 :class:`str` 物件時發生的"
"例外將被默默忽略。為了適當地處理錯誤,請改用 :c:func:"
"`PyMapping_GetItemString`。"
-#: ../../c-api/mapping.rst:84
+#: ../../c-api/mapping.rst:129
msgid ""
"On success, return a list of the keys in object *o*. On failure, return "
"``NULL``."
msgstr "成功時回傳一個物件 *o* 內之鍵的串列,失敗時回傳 ``NULL``。"
-#: ../../c-api/mapping.rst:87 ../../c-api/mapping.rst:96
-#: ../../c-api/mapping.rst:105
+#: ../../c-api/mapping.rst:132 ../../c-api/mapping.rst:141
+#: ../../c-api/mapping.rst:150
msgid "Previously, the function returned a list or a tuple."
msgstr "在以前,該函式會回傳串列或元組。"
-#: ../../c-api/mapping.rst:93
+#: ../../c-api/mapping.rst:138
msgid ""
"On success, return a list of the values in object *o*. On failure, return "
"``NULL``."
msgstr "成功時回傳物件 *o* 中值的串列。失敗時回傳 ``NULL``。"
-#: ../../c-api/mapping.rst:102
+#: ../../c-api/mapping.rst:147
msgid ""
"On success, return a list of the items in object *o*, where each item is a "
"tuple containing a key-value pair. On failure, return ``NULL``."
diff --git a/c-api/marshal.po b/c-api/marshal.po
index 536fc0744c..3e1eb7377f 100644
--- a/c-api/marshal.po
+++ b/c-api/marshal.po
@@ -5,7 +5,7 @@
# Translators:
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-20 00:03+0000\n"
"PO-Revision-Date: 2018-05-23 14:06+0000\n"
diff --git a/c-api/memory.po b/c-api/memory.po
index 27c22cf58f..e3b9669a9d 100644
--- a/c-api/memory.po
+++ b/c-api/memory.po
@@ -6,9 +6,9 @@
# Ching-Lung Chuang, 2015
msgid ""
msgstr ""
-"Project-Id-Version: Python 3.12\n"
+"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: 2024-09-24 07:20+0000\n"
"PO-Revision-Date: 2018-05-23 14:06+0000\n"
"Last-Translator: Adrian Liaw \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -135,59 +135,70 @@ msgid ""
"details on how every domain allocates memory or what internal functions each "
"domain calls is considered an implementation detail, but for debugging "
"purposes a simplified table can be found at :ref:`here `. There is no hard requirement to use the memory returned by the "
-"allocation functions belonging to a given domain for only the purposes "
-"hinted by that domain (although this is the recommended practice). For "
-"example, one could use the memory returned by :c:func:`PyMem_RawMalloc` for "
-"allocating Python objects or the memory returned by :c:func:"
-"`PyObject_Malloc` for allocating memory for buffers."
+"allocators>`. The APIs used to allocate and free a block of memory must be "
+"from the same domain. For example, :c:func:`PyMem_Free` must be used to free "
+"memory allocated using :c:func:`PyMem_Malloc`."
msgstr ""
-#: ../../c-api/memory.rst:112
+#: ../../c-api/memory.rst:109
msgid "The three allocation domains are:"
msgstr ""
-#: ../../c-api/memory.rst:114
+#: ../../c-api/memory.rst:111
msgid ""
"Raw domain: intended for allocating memory for general-purpose memory "
"buffers where the allocation *must* go to the system allocator or where the "
"allocator can operate without the :term:`GIL`. The memory is requested "
-"directly to the system."
+"directly from the system. See :ref:`Raw Memory Interface `."
msgstr ""
-#: ../../c-api/memory.rst:119
+#: ../../c-api/memory.rst:116
msgid ""
"\"Mem\" domain: intended for allocating memory for Python buffers and "
"general-purpose memory buffers where the allocation must be performed with "
-"the :term:`GIL` held. The memory is taken from the Python private heap."
+"the :term:`GIL` held. The memory is taken from the Python private heap. See :"
+"ref:`Memory Interface `."
msgstr ""
-#: ../../c-api/memory.rst:123
+#: ../../c-api/memory.rst:121
msgid ""
-"Object domain: intended for allocating memory belonging to Python objects. "
-"The memory is taken from the Python private heap."
+"Object domain: intended for allocating memory for Python objects. The memory "
+"is taken from the Python private heap. See :ref:`Object allocators "
+"`."
msgstr ""
#: ../../c-api/memory.rst:126
msgid ""
-"When freeing memory previously allocated by the allocating functions "
-"belonging to a given domain,the matching specific deallocating functions "
-"must be used. For example, :c:func:`PyMem_Free` must be used to free memory "
-"allocated using :c:func:`PyMem_Malloc`."
+"The :term:`free-threaded ` build requires that only Python "
+"objects are allocated using the \"object\" domain and that all Python "
+"objects are allocated using that domain. This differs from the prior Python "
+"versions, where this was only a best practice and not a hard requirement."
msgstr ""
-#: ../../c-api/memory.rst:131
-msgid "Raw Memory Interface"
+#: ../../c-api/memory.rst:130
+msgid ""
+"For example, buffers (non-Python objects) should be allocated using :c:func:"
+"`PyMem_Malloc`, :c:func:`PyMem_RawMalloc`, or :c:func:`malloc`, but not :c:"
+"func:`PyObject_Malloc`."
msgstr ""
#: ../../c-api/memory.rst:133
+msgid "See :ref:`Memory Allocation APIs `."
+msgstr ""
+
+#: ../../c-api/memory.rst:139
+msgid "Raw Memory Interface"
+msgstr ""
+
+#: ../../c-api/memory.rst:141
msgid ""
"The following function sets are wrappers to the system allocator. These "
"functions are thread-safe, the :term:`GIL ` does "
"not need to be held."
msgstr ""
-#: ../../c-api/memory.rst:137
+#: ../../c-api/memory.rst:145
msgid ""
"The :ref:`default raw memory allocator ` uses the "
"following functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` "
@@ -195,63 +206,63 @@ msgid ""
"requesting zero bytes."
msgstr ""
-#: ../../c-api/memory.rst:146 ../../c-api/memory.rst:217
-#: ../../c-api/memory.rst:325
+#: ../../c-api/memory.rst:154 ../../c-api/memory.rst:225
+#: ../../c-api/memory.rst:335
msgid ""
"Allocates *n* bytes and returns a pointer of type :c:expr:`void*` to the "
"allocated memory, or ``NULL`` if the request fails."
msgstr ""
-#: ../../c-api/memory.rst:149
+#: ../../c-api/memory.rst:157
msgid ""
"Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, "
"as if ``PyMem_RawMalloc(1)`` had been called instead. The memory will not "
"have been initialized in any way."
msgstr ""
-#: ../../c-api/memory.rst:156 ../../c-api/memory.rst:227
-#: ../../c-api/memory.rst:335
+#: ../../c-api/memory.rst:164 ../../c-api/memory.rst:235
+#: ../../c-api/memory.rst:345
msgid ""
"Allocates *nelem* elements each whose size in bytes is *elsize* and returns "
"a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if "
"the request fails. The memory is initialized to zeros."
msgstr ""
-#: ../../c-api/memory.rst:160
+#: ../../c-api/memory.rst:168
msgid ""
"Requesting zero elements or elements of size zero bytes returns a distinct "
"non-``NULL`` pointer if possible, as if ``PyMem_RawCalloc(1, 1)`` had been "
"called instead."
msgstr ""
-#: ../../c-api/memory.rst:169 ../../c-api/memory.rst:240
-#: ../../c-api/memory.rst:348
+#: ../../c-api/memory.rst:177 ../../c-api/memory.rst:248
+#: ../../c-api/memory.rst:358
msgid ""
"Resizes the memory block pointed to by *p* to *n* bytes. The contents will "
"be unchanged to the minimum of the old and the new sizes."
msgstr ""
-#: ../../c-api/memory.rst:172
+#: ../../c-api/memory.rst:180
msgid ""
"If *p* is ``NULL``, the call is equivalent to ``PyMem_RawMalloc(n)``; else "
"if *n* is equal to zero, the memory block is resized but is not freed, and "
"the returned pointer is non-``NULL``."
msgstr ""
-#: ../../c-api/memory.rst:176
+#: ../../c-api/memory.rst:184
msgid ""
"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:"
"func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:func:"
"`PyMem_RawCalloc`."
msgstr ""
-#: ../../c-api/memory.rst:180
+#: ../../c-api/memory.rst:188
msgid ""
"If the request fails, :c:func:`PyMem_RawRealloc` returns ``NULL`` and *p* "
"remains a valid pointer to the previous memory area."
msgstr ""
-#: ../../c-api/memory.rst:186
+#: ../../c-api/memory.rst:194
msgid ""
"Frees the memory block pointed to by *p*, which must have been returned by a "
"previous call to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:"
@@ -259,73 +270,73 @@ msgid ""
"called before, undefined behavior occurs."
msgstr ""
-#: ../../c-api/memory.rst:191 ../../c-api/memory.rst:261
-#: ../../c-api/memory.rst:369
+#: ../../c-api/memory.rst:199 ../../c-api/memory.rst:269
+#: ../../c-api/memory.rst:379
msgid "If *p* is ``NULL``, no operation is performed."
msgstr ""
-#: ../../c-api/memory.rst:197
+#: ../../c-api/memory.rst:205
msgid "Memory Interface"
msgstr "記憶體介面"
-#: ../../c-api/memory.rst:199 ../../c-api/memory.rst:305
+#: ../../c-api/memory.rst:207 ../../c-api/memory.rst:315
msgid ""
"The following function sets, modeled after the ANSI C standard, but "
"specifying behavior when requesting zero bytes, are available for allocating "
"and releasing memory from the Python heap."
msgstr ""
-#: ../../c-api/memory.rst:203
+#: ../../c-api/memory.rst:211
msgid ""
"The :ref:`default memory allocator ` uses the :"
"ref:`pymalloc memory allocator `."
msgstr ""
-#: ../../c-api/memory.rst:208 ../../c-api/memory.rst:320
+#: ../../c-api/memory.rst:216 ../../c-api/memory.rst:330
msgid ""
"The :term:`GIL ` must be held when using these "
"functions."
msgstr ""
-#: ../../c-api/memory.rst:213
+#: ../../c-api/memory.rst:221
msgid ""
"The default allocator is now pymalloc instead of system :c:func:`malloc`."
msgstr ""
-#: ../../c-api/memory.rst:220
+#: ../../c-api/memory.rst:228
msgid ""
"Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, "
"as if ``PyMem_Malloc(1)`` had been called instead. The memory will not have "
"been initialized in any way."
msgstr ""
-#: ../../c-api/memory.rst:231
+#: ../../c-api/memory.rst:239
msgid ""
"Requesting zero elements or elements of size zero bytes returns a distinct "
"non-``NULL`` pointer if possible, as if ``PyMem_Calloc(1, 1)`` had been "
"called instead."
msgstr ""
-#: ../../c-api/memory.rst:243
+#: ../../c-api/memory.rst:251
msgid ""
"If *p* is ``NULL``, the call is equivalent to ``PyMem_Malloc(n)``; else if "
"*n* is equal to zero, the memory block is resized but is not freed, and the "
"returned pointer is non-``NULL``."
msgstr ""
-#: ../../c-api/memory.rst:247
+#: ../../c-api/memory.rst:255
msgid ""
"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:"
"func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`."
msgstr ""
-#: ../../c-api/memory.rst:250
+#: ../../c-api/memory.rst:258
msgid ""
"If the request fails, :c:func:`PyMem_Realloc` returns ``NULL`` and *p* "
"remains a valid pointer to the previous memory area."
msgstr ""
-#: ../../c-api/memory.rst:256
+#: ../../c-api/memory.rst:264
msgid ""
"Frees the memory block pointed to by *p*, which must have been returned by a "
"previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:"
@@ -333,20 +344,20 @@ msgid ""
"undefined behavior occurs."
msgstr ""
-#: ../../c-api/memory.rst:263
+#: ../../c-api/memory.rst:271
msgid ""
"The following type-oriented macros are provided for convenience. Note that "
"*TYPE* refers to any C type."
msgstr ""
-#: ../../c-api/memory.rst:269
+#: ../../c-api/memory.rst:277
msgid ""
"Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes "
"of memory. Returns a pointer cast to ``TYPE*``. The memory will not have "
"been initialized in any way."
msgstr ""
-#: ../../c-api/memory.rst:276
+#: ../../c-api/memory.rst:284
msgid ""
"Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * "
"sizeof(TYPE))`` bytes. Returns a pointer cast to ``TYPE*``. On return, *p* "
@@ -354,17 +365,17 @@ msgid ""
"failure."
msgstr ""
-#: ../../c-api/memory.rst:281
+#: ../../c-api/memory.rst:289
msgid ""
"This is a C preprocessor macro; *p* is always reassigned. Save the original "
"value of *p* to avoid losing memory when handling errors."
msgstr ""
-#: ../../c-api/memory.rst:287
+#: ../../c-api/memory.rst:295
msgid "Same as :c:func:`PyMem_Free`."
msgstr "和 :c:func:`PyMem_Free` 相同。"
-#: ../../c-api/memory.rst:289
+#: ../../c-api/memory.rst:297
msgid ""
"In addition, the following macro sets are provided for calling the Python "
"memory allocator directly, without involving the C API functions listed "
@@ -372,35 +383,35 @@ msgid ""
"across Python versions and is therefore deprecated in extension modules."
msgstr ""
-#: ../../c-api/memory.rst:294
+#: ../../c-api/memory.rst:302
msgid "``PyMem_MALLOC(size)``"
msgstr "``PyMem_MALLOC(size)``"
-#: ../../c-api/memory.rst:295
+#: ../../c-api/memory.rst:303
msgid "``PyMem_NEW(type, size)``"
msgstr "``PyMem_NEW(type, size)``"
-#: ../../c-api/memory.rst:296
+#: ../../c-api/memory.rst:304
msgid "``PyMem_REALLOC(ptr, size)``"
msgstr "``PyMem_REALLOC(ptr, size)``"
-#: ../../c-api/memory.rst:297
+#: ../../c-api/memory.rst:305
msgid "``PyMem_RESIZE(ptr, type, size)``"
msgstr "``PyMem_RESIZE(ptr, type, size)``"
-#: ../../c-api/memory.rst:298
+#: ../../c-api/memory.rst:306
msgid "``PyMem_FREE(ptr)``"
msgstr "``PyMem_FREE(ptr)``"
-#: ../../c-api/memory.rst:299
+#: ../../c-api/memory.rst:307
msgid "``PyMem_DEL(ptr)``"
msgstr "``PyMem_DEL(ptr)``"
-#: ../../c-api/memory.rst:303
+#: ../../c-api/memory.rst:313
msgid "Object allocators"
msgstr ""
-#: ../../c-api/memory.rst:310
+#: ../../c-api/memory.rst:320
msgid ""
"There is no guarantee that the memory returned by these allocators can be "
"successfully cast to a Python object when intercepting the allocating "
@@ -408,47 +419,47 @@ msgid ""
"Memory Allocators ` section."
msgstr ""
-#: ../../c-api/memory.rst:315
+#: ../../c-api/memory.rst:325
msgid ""
"The :ref:`default object allocator ` uses the :"
"ref:`pymalloc memory allocator `."
msgstr ""
-#: ../../c-api/memory.rst:328
+#: ../../c-api/memory.rst:338
msgid ""
"Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, "
"as if ``PyObject_Malloc(1)`` had been called instead. The memory will not "
"have been initialized in any way."
msgstr ""
-#: ../../c-api/memory.rst:339
+#: ../../c-api/memory.rst:349
msgid ""
"Requesting zero elements or elements of size zero bytes returns a distinct "
"non-``NULL`` pointer if possible, as if ``PyObject_Calloc(1, 1)`` had been "
"called instead."
msgstr ""
-#: ../../c-api/memory.rst:351
+#: ../../c-api/memory.rst:361
msgid ""
"If *p* is ``NULL``, the call is equivalent to ``PyObject_Malloc(n)``; else "
"if *n* is equal to zero, the memory block is resized but is not freed, and "
"the returned pointer is non-``NULL``."
msgstr ""
-#: ../../c-api/memory.rst:355
+#: ../../c-api/memory.rst:365
msgid ""
"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:"
"func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:func:"
"`PyObject_Calloc`."
msgstr ""
-#: ../../c-api/memory.rst:358
+#: ../../c-api/memory.rst:368
msgid ""
"If the request fails, :c:func:`PyObject_Realloc` returns ``NULL`` and *p* "
"remains a valid pointer to the previous memory area."
msgstr ""
-#: ../../c-api/memory.rst:364
+#: ../../c-api/memory.rst:374
msgid ""
"Frees the memory block pointed to by *p*, which must have been returned by a "
"previous call to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:"
@@ -456,277 +467,283 @@ msgid ""
"called before, undefined behavior occurs."
msgstr ""
-#: ../../c-api/memory.rst:375
+#: ../../c-api/memory.rst:385
msgid "Default Memory Allocators"
msgstr ""
-#: ../../c-api/memory.rst:377
+#: ../../c-api/memory.rst:387
msgid "Default memory allocators:"
msgstr ""
-#: ../../c-api/memory.rst:380
+#: ../../c-api/memory.rst:390
msgid "Configuration"
msgstr "配置"
-#: ../../c-api/memory.rst:380
+#: ../../c-api/memory.rst:390
msgid "Name"
msgstr "名稱"
-#: ../../c-api/memory.rst:380
+#: ../../c-api/memory.rst:390
msgid "PyMem_RawMalloc"
msgstr "PyMem_RawMalloc"
-#: ../../c-api/memory.rst:380
+#: ../../c-api/memory.rst:390
msgid "PyMem_Malloc"
msgstr "PyMem_Malloc"
-#: ../../c-api/memory.rst:380
+#: ../../c-api/memory.rst:390
msgid "PyObject_Malloc"
msgstr "PyObject_Malloc"
-#: ../../c-api/memory.rst:382
+#: ../../c-api/memory.rst:392
msgid "Release build"
msgstr ""
-#: ../../c-api/memory.rst:382
+#: ../../c-api/memory.rst:392
msgid "``\"pymalloc\"``"
msgstr "``\"pymalloc\"``"
-#: ../../c-api/memory.rst:382 ../../c-api/memory.rst:384
+#: ../../c-api/memory.rst:392 ../../c-api/memory.rst:394
msgid "``malloc``"
msgstr "``malloc``"
-#: ../../c-api/memory.rst:382
+#: ../../c-api/memory.rst:392
msgid "``pymalloc``"
msgstr "``pymalloc``"
-#: ../../c-api/memory.rst:383
+#: ../../c-api/memory.rst:393
msgid "Debug build"
msgstr ""
-#: ../../c-api/memory.rst:383
+#: ../../c-api/memory.rst:393
msgid "``\"pymalloc_debug\"``"
msgstr "``\"pymalloc_debug\"``"
-#: ../../c-api/memory.rst:383 ../../c-api/memory.rst:385
+#: ../../c-api/memory.rst:393 ../../c-api/memory.rst:395
msgid "``malloc`` + debug"
msgstr ""
-#: ../../c-api/memory.rst:383
+#: ../../c-api/memory.rst:393
msgid "``pymalloc`` + debug"
msgstr ""
-#: ../../c-api/memory.rst:384
+#: ../../c-api/memory.rst:394
msgid "Release build, without pymalloc"
msgstr ""
-#: ../../c-api/memory.rst:384
+#: ../../c-api/memory.rst:394
msgid "``\"malloc\"``"
msgstr "``\"malloc\"``"
-#: ../../c-api/memory.rst:385
+#: ../../c-api/memory.rst:395
msgid "Debug build, without pymalloc"
msgstr ""
-#: ../../c-api/memory.rst:385
+#: ../../c-api/memory.rst:395
msgid "``\"malloc_debug\"``"
msgstr "``\"malloc_debug\"``"
-#: ../../c-api/memory.rst:388
+#: ../../c-api/memory.rst:398
msgid "Legend:"
msgstr ""
-#: ../../c-api/memory.rst:390
+#: ../../c-api/memory.rst:400
msgid "Name: value for :envvar:`PYTHONMALLOC` environment variable."
msgstr ""
-#: ../../c-api/memory.rst:391
+#: ../../c-api/memory.rst:401
msgid ""
"``malloc``: system allocators from the standard C library, C functions: :c:"
"func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`."
msgstr ""
-#: ../../c-api/memory.rst:393
+#: ../../c-api/memory.rst:403
msgid "``pymalloc``: :ref:`pymalloc memory allocator